Topic: Add compiler time attributes like c#
Author: maksimpustovoyt@gmail.com
Date: Tue, 29 Apr 2014 22:41:08 -0700 (PDT)
Raw View
------=_Part_894_29841539.1398836468280
Content-Type: text/plain; charset=UTF-8
Add attribute like a c#:
Example 1:
[ ClsAttr(Name = "MyClassA")]
[ GenerateClassMetaData(true)]
struct TestA {
[MemberAttr(Name = "A", IsCaseSensitive=false, DefaultValue=234_]
int A;
[MemberAttr(Name = "B", IsCaseSensitive=false, DefaultValue=234,
Range(1,10)) }
int B;
[StringFormat("###.#") ]
[DefaultValue("000.0"]
string text;
[MethodAttr(Name="Sum"]
int Add (
[Range(0,4)]
int a,
[Arg.Attr(Name="second", DefaultValue =20)] int b
) { return a + b; }
}
====================================================
..... The compiler will generate static Metadata Object
..........
printf ( "Class name=%s", TestA::Type::ClsAttr::Name);
....
Also if the class specify [GenerateClassMetaData(true)] attribute the
compiler will generate static class of meta such as "data members",
"methods", "constructors",
For example:
for (auto = TestA::Methods.begin(); ) {
MethodInfo method_info = *it;
printf("Method name=%s", method_info.Name);
.........
Also it will provide method to set value such as:
TestA
====================================================
There will be predefined Attribute classes such as ClsAttr or META_DATA, ...
Also coder can create own:
[ META_DATA]
struct StringArgument {
string Name;
string DefValue;
string Format;
}
Please see C# Custom attributes for more information
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_894_29841539.1398836468280
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><br></div><div><br></div><div>Add attribute like a c#=
:</div><div><br></div><div>Example 1:</div><div><br></div><div>[ ClsAttr(Na=
me =3D "MyClassA")]</div><div>[ GenerateClassMetaData(true)]</div><div>stru=
ct TestA {</div><div><br></div><div> [MemberAttr(Name =3D =
"A", IsCaseSensitive=3Dfalse, DefaultValue=3D234_]</div><div> i=
nt A;</div><div><br></div><div><div> [MemberAttr(Name =3D "B", =
IsCaseSensitive=3Dfalse, DefaultValue=3D234, Range(1,10)) }</div><div> =
; int B;</div><div><br></div><div><br></div><div> [=
StringFormat("###.#") ]</div><div> [DefaultValue("000.0"]=
</div><div> string text;</div></div><div><br></div><div> =
[MethodAttr(Name=3D"Sum"]</div><div> int Add=
(</div><div> [Range(0,4)] &=
nbsp; &nb=
sp; =
&nb=
sp; =
int a, </div><div> &n=
bsp;[Arg.Attr(Name=3D"second", DefaultValue =3D20)] int b</div>=
<div> ) { return a + b; } </div><div>}<=
/div><div>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D</div><div>.... The compiler will generate static Metadat=
a Object </div><div><br></div><div> &nbs=
p; ..........</div><div> &nb=
sp; printf ( "Class name=3D%s", TestA::=
Type::ClsAttr::Name);</div><div><br></div><div>...</div><div>Also if the cl=
ass specify [GenerateClassMetaData(true)] attribute the compiler will gener=
ate static class of meta such as "data members", "methods", "constructors",=
</div><div>For example:</div><div> for (auto =
=3D TestA::Methods.begin(); ) {</div><div> Me=
thodInfo method_info =3D *it;</div><div> prin=
tf("Method name=3D%s", method_info.Name);</div><div><br></div><div><br></di=
v><div> &n=
bsp; .........</div><div>Also it will provide method to set value suc=
h as:</div><div>TestA </div=
><div><br></div><div><br></div><div>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</div><div>There will be predefin=
ed Attribute classes such as ClsAttr or META_DATA, ...</div><div><br></div>=
<div>Also coder can create own:</div><div><br></div><div><br></div><di=
v>[ META_DATA]</div><div>struct StringArgument {</div><div>  =
; string Name;</div><div> string DefValue;</div><di=
v> string Format;</div><div> }</div><div><br></div><=
div><br></div><div>Please see C# Custom attributes for more information</di=
v><div><br></div><div><br></div><div><br></div><div><br></div><div><br></di=
v><div><br></div><div><br></div><div><br></div><div><br></div><div><br></di=
v><div><br></div><div><br></div><div><br></div><div><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_894_29841539.1398836468280--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Wed, 30 Apr 2014 14:13:44 +0200
Raw View
--089e01538c56e12dee04f8417a9b
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
C++11 already have =E2=80=8Battributes. See:
en.cppreference.com/w/cpp/language/attributes
Or are you suggesting specific attributes to be standardised?
If yes, then your example is not clear at all to me.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--089e01538c56e12dee04f8417a9b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">C++11 already have=C2=A0=E2=80=8Battributes. See:=C2=A0<a =
href=3D"http://en.cppreference.com/w/cpp/language/attributes">en.cppreferen=
ce.com/w/cpp/language/attributes</a><div>Or are you suggesting specific att=
ributes to be standardised?<div>
If yes, then your example is not clear at all to me.</div><div><br></div></=
div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--089e01538c56e12dee04f8417a9b--
.
Author: gmisocpp@gmail.com
Date: Wed, 30 Apr 2014 05:59:51 -0700 (PDT)
Raw View
------=_Part_43_6313912.1398862791181
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
This is fun.
On Thursday, May 1, 2014 12:13:44 AM UTC+12, Klaim - Jo=C3=ABl Lamotte wrot=
e:
>
> C++11 already have =E2=80=8Battributes. See:=20
> en.cppreference.com/w/cpp/language/attributes
>
Yes sadly, it's true.
=20
> Or are you suggesting specific attributes to be standardised?
> If yes, then your example is not clear at all to me.
>
> I'd quite like to see [[warn_unused_result]] become standard.
http://stackoverflow.com/questions/2042780/how-to-raise-warning-if-return-v=
alue-is-disregarded-gcc-or-static-code-check
btw. anyone think we're ready to add things like [[unused_arg]] yet?
Thanks
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_43_6313912.1398862791181
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br>This is fun.<br>On Thursday, May 1, 2014 12:13:44 AM U=
TC+12, Klaim - Jo=C3=ABl Lamotte wrote:<blockquote class=3D"gmail_quote" st=
yle=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb=
(204, 204, 204); border-left-width: 1px; border-left-style: solid;"><div di=
r=3D"ltr">C++11 already have =E2=80=8Battributes. See: <a onmouse=
down=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fen.cpprefer=
ence.com%2Fw%2Fcpp%2Flanguage%2Fattributes\46sa\75D\46sntz\0751\46usg\75AFQ=
jCNH9Dk3GSNX7l_TUTRgP10mO8NSFVQ';return true;" onclick=3D"this.href=3D'http=
://www.google.com/url?q\75http%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Flang=
uage%2Fattributes\46sa\75D\46sntz\0751\46usg\75AFQjCNH9Dk3GSNX7l_TUTRgP10mO=
8NSFVQ';return true;" href=3D"http://en.cppreference.com/w/cpp/language/att=
ributes" target=3D"_blank">en.cppreference.com/w/<wbr>cpp/language/attribut=
es</a></div></blockquote><div>Yes sadly, it's true.</div><div> </div><=
blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddin=
g-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px;=
border-left-style: solid;"><div dir=3D"ltr"><div>Or are you suggesting spe=
cific attributes to be standardised?<div>
If yes, then your example is not clear at all to me.</div><div><br></div></=
div></div></blockquote><div>I'd quite like to see [[warn_unused_result=
]] become standard.</div><div><a href=3D"http://stackoverflow.com/questions=
/2042780/how-to-raise-warning-if-return-value-is-disregarded-gcc-or-static-=
code-check">http://stackoverflow.com/questions/2042780/how-to-raise-warning=
-if-return-value-is-disregarded-gcc-or-static-code-check</a></div><div><br>=
</div><div>btw. anyone think we're ready to add things like [[unused_a=
rg]] yet?</div><div><br></div><div>Thanks</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_43_6313912.1398862791181--
.
Author: Jean-Marc Bourguet <jm.bourguet@gmail.com>
Date: Wed, 30 Apr 2014 06:56:24 -0700 (PDT)
Raw View
------=_Part_4605_40800.1398866184617
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Le mercredi 30 avril 2014 14:59:51 UTC+2, gmis...@gmail.com a =C3=A9crit :
>
> btw. anyone think we're ready to add things like [[unused_arg]] yet?
>
> We don't need an attribute for that, we already can avoid giving a name t=
o=20
the argument.
Yours,
--=20
Jean-Marc
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_4605_40800.1398866184617
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Le mercredi 30 avril 2014 14:59:51 UTC+2, gmis...@gmail.co=
m a =C3=A9crit :<blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div>btw. anyone think we're ready to add things like [[unuse=
d_arg]] yet?<br></div><div><br></div></div></blockquote><div>We don't need =
an attribute for that, we already can avoid giving a name to the argument.<=
/div><div><br></div><div>Yours,</div><div><br></div><div>-- </div><div=
>Jean-Marc</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_4605_40800.1398866184617--
.
Author: gmisocpp@gmail.com
Date: Wed, 30 Apr 2014 08:31:27 -0700 (PDT)
Raw View
------=_Part_2471_14610865.1398871887857
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi
On Thursday, May 1, 2014 1:56:24 AM UTC+12, Jean-Marc Bourguet wrote:
>
> Le mercredi 30 avril 2014 14:59:51 UTC+2, gmis...@gmail.com a =C3=A9crit =
:
>>
>> btw. anyone think we're ready to add things like [[unused_arg]] yet?
>>
>> We don't need an attribute for that, we already can avoid giving a name=
=20
> to the argument.
>
Not naming an argument is really undesirable, it means amongst other=20
things, you can't as easily look at the value of the argument in some=20
debuggers. It's makes for poor documentation.
I don't think we should accept the status quo on this.
>
> Yours,
>
> --=20
> Jean-Marc
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_2471_14610865.1398871887857
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi<br><br>On Thursday, May 1, 2014 1:56:24 AM UTC+12, Jean=
-Marc Bourguet wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0px=
0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); b=
order-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr">Le mercr=
edi 30 avril 2014 14:59:51 UTC+2, <a>gmis...@gmail.com</a> a =C3=A9crit&nbs=
p;:<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; pa=
dding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: =
1px; border-left-style: solid;"><div dir=3D"ltr"><div>btw. anyone think we'=
re ready to add things like [[unused_arg]] yet?<br></div><div><br></di=
v></div></blockquote><div>We don't need an attribute for that, we already c=
an avoid giving a name to the argument.</div></div></blockquote><div><br></=
div><div>Not naming an argument is really undesirable, it means a=
mongst other things, you can't as easily look at the value of the=
argument in some debuggers. It's makes for poor documentati=
on.</div><div><br></div><div>I don't think we should accept the status quo =
on this.</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0p=
x 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-l=
eft-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div><br></div>=
<div>Yours,</div><div><br></div><div>-- </div><div>Jean-Marc</div></di=
v></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_2471_14610865.1398871887857--
.
Author: maksimpustovoyt@gmail.com
Date: Wed, 30 Apr 2014 09:38:30 -0700 (PDT)
Raw View
------=_Part_1384_8877558.1398875910719
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
This is different than C++11 attributes.
This is extendable Metadata about class which you can use in real time.
For example, I want to print my object in nice format. I can do something=
=20
like that:
[AttributeExtension] //This predefine attribute "AttributeExtension" tells=
=20
compiler that this class can be used as Attribute for other classes:
struct MyAttribute {
string Name;
string Description;
MyAttribute(string name; string description=3D "") : Name(name),=20
Description(description) {}
}
[AttributeExtension] // This predefine attribute "AttributeExtension" tells=
=20
compiler that this class can be used as Attribute for other classes:
struct AgeRange {=20
int Minum;
int Maximum;
AgeRange(int minum; int maximum) Minum(minum), Maximum(maximum) {}
}
.... some time later in code...
[METADATA(true)] // tells compiler to geneate meta data about my class
[MyAttribute("Person", "This this class 'Person' description")] // called=
=20
MyAttribute::MyAttribute("class A", "This this class 'A' description")
struct Person {
[MyAttribute("Fist Name")] // called MyAttribute::MyAttribute("class A",=
=20
"This this class 'A' description")
string FirstName;
[MyAttribute("Last Name", "Person's last name")] // called=20
MyAttribute::MyAttribute("class A", "This this class 'A' description")=20
string LastName;
[AgeRange(18,50)]
int ValidAge;
}
.... some time later in code...
bool CanRegisterPerson(Person &person) {=20
if (person.ValidAge < Person::Member::ValidAge::AgeRange::Minimum) return=
=20
false;
if (person.ValidAge > Person::Member::ValidAge::AgeRange::Maximum) return=
=20
false;
return true;
}
bool RegisterPerson(Person &person) {=20
if (!CanRegisterPerson(person)) {
printf("Cannot register person %s:%s, %s:%s because age %d must be in=20
between %d and %d\n"
,person::Member::FirstName::MyAttribute::Name.c_str()
,person.FistName.c_str()
,person::Member::LastName::MyAttribute::Name.c_str()
,person.LastName.c_str() =20
,person.Age
,Person::Member::ValidAge::AgeRange::Minimum
,Person::Member::ValidAge::AgeRange::Maximum
return false;
);
return true; =20
}
}
On Wednesday, April 30, 2014 8:59:51 AM UTC-4, gmis...@gmail.com wrote:
>
> This is fun.
> On Thursday, May 1, 2014 12:13:44 AM UTC+12, Klaim - Jo=C3=ABl Lamotte wr=
ote:
>>
>> C++11 already have =E2=80=8Battributes. See:=20
>> en.cppreference.com/w/cpp/language/attributes
>>
> Yes sadly, it's true.=20
>
=20
>
>> Or are you suggesting specific attributes to be standardised?
>> If yes, then your example is not clear at all to me.
>>
>> I'd quite like to see [[warn_unused_result]] become standard.
>
> http://stackoverflow.com/questions/2042780/how-to-raise-warning-if-return=
-value-is-disregarded-gcc-or-static-code-check
>
> btw. anyone think we're ready to add things like [[unused_arg]] yet?
>
> Thanks
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_1384_8877558.1398875910719
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>This is different than C++11 attributes.</div><div>Th=
is is extendable Metadata about class which you can use in real time.</div>=
<div>For example, I want to print my object in nice format. I can do someth=
ing like that:</div><div>[AttributeExtension] <font color=3D"#38761d"=
>//This predefine attribute "AttributeExtension" tells compiler that this c=
lass can be used as Attribute for other classes:</font><br>struct MyAttribu=
te {<br> string Name;<br> string Descri=
ption;<br> MyAttribute(string name; string description=3D=
"") : Name(name), Description(description) {}<br>}<br>[AttributeExtension]=
<font color=3D"#6aa84f"> // This predefine attribute "AttributeExtension" t=
ells compiler that this class can be used as Attribute for other classes</f=
ont>:<br>struct AgeRange { <br> int Minum;<br> =
int Maximum;<br> AgeRange(int minum; int maximum) Minum(minum), =
Maximum(maximum) {}<br>}</div><div><br></div><div><font color=3D"#76a5af">.=
... some time later in code...</font></div><div><font color=3D"#76a5af"></fo=
nt><br>[METADATA(true)] <font color=3D"#38761d">// tells compiler to geneat=
e meta data about my class</font><br>[MyAttribute("Person", "This this clas=
s 'Person' description")] // called MyAttribute::MyAttribute("class A", "Th=
is this class 'A' description")<br>struct Person {<br> [MyAttribute("F=
ist Name")] // called MyAttribute::MyAttribute("class A", "This this class =
'A' description")<br> string FirstName;<br> [MyAttribute("Last Na=
me", "Person's last name")] // called MyAttribute::MyAttribute("class A", "=
This this class 'A' description") <br> string LastName;<br> =
[AgeRange(18,50)]<br> int ValidAge;<br>}</div><div><br><font color=3D"=
#38761d">... some time later in code...</font></div><div><font color=3D"#38=
761d"><br></font></div><div>bool CanRegisterPerson(Person &person) {&nb=
sp;<br> if (person.ValidAge < Person::Member::ValidAge::AgeRange::M=
inimum) return false;<br> if (person.ValidAge > Person::Member::Val=
idAge::AgeRange::Maximum) return false;<br> return true;<br>}</div><di=
v><br></div><div>bool RegisterPerson(Person &person) { <br> i=
f (!CanRegisterPerson(person)) {<br> printf("Cannot register per=
son %s:%s, %s:%s because age %d must be in between %d and %d\n"<br> &n=
bsp; ,person::Member::FirstName::MyAttribute::Name.c_str()<br> &n=
bsp; ,person.FistName.c_str()<br> ,person::Member::La=
stName::MyAttribute::Name.c_str()<br> ,person.LastName.c_s=
tr() <br> ,person.Age<br> &nbs=
p;,Person::Member::ValidAge::AgeRange::Minimum<br> ,Person=
::Member::ValidAge::AgeRange::Maximum<br> return false;<br=
> );<br> return true; <br> }</div><di=
v>}</div><div><br></div><div><br></div><div><br></div><div>On Wednesday, Ap=
ril 30, 2014 8:59:51 AM UTC-4, gmis...@gmail.com wrote:</div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; =
border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-=
style: solid;"><div dir=3D"ltr"><br>This is fun.<br>On Thursday, May 1, 201=
4 12:13:44 AM UTC+12, Klaim - Jo=C3=ABl Lamotte wrote:<blockquote class=3D"=
gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-=
left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: =
solid;"><div dir=3D"ltr">C++11 already have =E2=80=8Battributes. See:&=
nbsp;<a onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2=
F%2Fen.cppreference.com%2Fw%2Fcpp%2Flanguage%2Fattributes\46sa\75D\46sntz\0=
751\46usg\75AFQjCNH9Dk3GSNX7l_TUTRgP10mO8NSFVQ';return true;" onclick=3D"th=
is.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fen.cppreference.com%2=
Fw%2Fcpp%2Flanguage%2Fattributes\46sa\75D\46sntz\0751\46usg\75AFQjCNH9Dk3GS=
NX7l_TUTRgP10mO8NSFVQ';return true;" href=3D"http://en.cppreference.com/w/c=
pp/language/attributes" target=3D"_blank">en.cppreference.com/w/<wbr>cpp/la=
nguage/attributes</a></div></blockquote><div>Yes sadly, it's true. </d=
iv></div></blockquote><blockquote class=3D"gmail_quote" style=3D"margin: 0p=
x 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); =
border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>&n=
bsp;</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.=
8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-=
width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>Or are you sug=
gesting specific attributes to be standardised?<div>
If yes, then your example is not clear at all to me.</div><div><br></div></=
div></div></blockquote><div>I'd quite like to see [[warn_unused_result=
]] become standard.</div><div><a onmousedown=3D"this.href=3D'http://www.goo=
gle.com/url?q\75http%3A%2F%2Fstackoverflow.com%2Fquestions%2F2042780%2Fhow-=
to-raise-warning-if-return-value-is-disregarded-gcc-or-static-code-check\46=
sa\75D\46sntz\0751\46usg\75AFQjCNGYZ5htWBjGw25kKD3kPRdRZYT69Q';return true;=
" onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fstacko=
verflow.com%2Fquestions%2F2042780%2Fhow-to-raise-warning-if-return-value-is=
-disregarded-gcc-or-static-code-check\46sa\75D\46sntz\0751\46usg\75AFQjCNGY=
Z5htWBjGw25kKD3kPRdRZYT69Q';return true;" href=3D"http://stackoverflow.com/=
questions/2042780/how-to-raise-warning-if-return-value-is-disregarded-gcc-o=
r-static-code-check" target=3D"_blank">http://stackoverflow.com/<wbr>questi=
ons/2042780/how-to-<wbr>raise-warning-if-return-value-<wbr>is-disregarded-g=
cc-or-static-<wbr>code-check</a></div><div><br></div><div>btw. anyone think=
we're ready to add things like [[unused_arg]] yet?</div><div><br></di=
v><div>Thanks</div></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_1384_8877558.1398875910719--
.
Author: maksimpustovoyt@gmail.com
Date: Wed, 30 Apr 2014 09:45:28 -0700 (PDT)
Raw View
------=_Part_162_29231422.1398876328816
Content-Type: text/plain; charset=UTF-8
CORRECTED SOME TYPO FROM PREVIOSE POST
This is different than C++11 attributes.
This is extendable Metadata about class which you can use in real time.
For example, I want to print my object in nice format. I can do something
like that:
[AttributeExtension] // This predefine Attribute telling compiler that this
class can be used as Attribute for other classes:
struct MyAttribute {
string Name;
string Description;
MyAttribute(string name; string description= "") : Name(name),
Description(description) {}
}
[AttributeExtension] // This predefine Attribute telling compiler that this
class can be used as Attribute for other classes:
struct AgeRange {
int Minum;
int Maximum;
AgeRange(int minum; int maximum) Minum(minum), Maximum(maximum) {}
}
.... some time later in code...
[METADATA(true)] // tells compiler to geneate meta data about my class
[MyAttribute("Person", "Person Info")] // called
MyAttribute::MyAttribute("Person", "Person Info")
struct Person {
[MyAttribute("Fist Name")] // called MyAttribute::MyAttribute("Fist Name")
string FirstName;
[MyAttribute("Last Name", "Person's last name")] // called
MyAttribute::MyAttribute("Last Name", "Person's last name")
string LastName;
[AgeRange(18,50)] // called AgeRange::AgeRange(18,50)
int ValidAge;
}
.... some time later in code...
bool CanRegisterPerson(Person &person) {
if (person.ValidAge < Person::Member::ValidAge::AgeRange::Minimum) return
false; //
if (person.ValidAge > Person::Member::ValidAge::AgeRange::Maximum) return
false;
return true;
}
bool RegisterPerson(Person &person) {
if (!CanRegisterPerson(person)) {
printf("Cannot register person %s:%s, %s:%s because age %d must be in
between %d and %d\n"
,person::Member::FirstName::MyAttribute::Name.c_str()
,person.FistName.c_str()
,person::Member::LastName::MyAttribute::Name.c_str()
,person.LastName.c_str()
,person.Age
,Person::Member::ValidAge::AgeRange::Minimum
,Person::Member::ValidAge::AgeRange::Maximum
return false;
);
return true;
}
}
>
>
>
>
>
>
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_162_29231422.1398876328816
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><br></div><div><br></div><div>CORRECTED SOME TYPO FRO=
M PREVIOSE POST</div><p><br>This is different than C++11 attributes.</p><p>=
This is extendable Metadata about class which you can use in real time.</p>=
<p>For example, I want to print my object in nice format. I can do somethin=
g like that:</p><p>[AttributeExtension] <font color=3D"#38761d">// This pre=
define Attribute telling compiler that this class can be used as Attribute =
for other classes:</font><br>struct MyAttribute {<br> str=
ing Name;<br> string Description;<br> M=
yAttribute(string name; string description=3D "") : Name(name), Description=
(description) {}<br>}<br>[AttributeExtension] <font color=3D"#38761d">// Th=
is predefine Attribute telling compiler that this class can be used as Attr=
ibute for other classes:</font><br>struct AgeRange { <br> &=
nbsp; int Minum;<br> int Maximum;<br> AgeRange(int minum; int max=
imum) Minum(minum), Maximum(maximum) {}<br>}</p><p><br></p><div><font=
color=3D"#134f5c">... some time later in code...</font></div><div><font co=
lor=3D"#134f5c"></font><br>[METADATA(true)] <font color=3D"#38761d">// tell=
s compiler to geneate meta data about my class</font><br>[MyAttribute("Pers=
on", "Person Info")] <font color=3D"#6aa84f">// called MyAttribute::MyAttri=
bute("Person", "Person Info")</font><br>struct Person {<br> [MyAttribu=
te("Fist Name")] <font color=3D"#6aa84f">// called MyAttribute::MyAttribute=
("Fist Name")</font><br> string FirstName;<br> [MyAttribute("Last=
Name", "Person's last name")] <font color=3D"#6aa84f">// called MyAttribut=
e::MyAttribute("Last Name", "Person's last name")</font> <br> str=
ing LastName;<br> [AgeRange(18,50)]<font color=3D"#38761d"> // called =
AgeRange::AgeRange(18,50)</font> <br> int ValidAge;<br>}</div><p>=
<br>... some time later in code...</p><p>bool CanRegisterPerson(Person &=
;person) { <br> if (person.ValidAge < Person::Member::ValidAge=
::AgeRange::Minimum) return false; // <br> if (person.ValidAge &g=
t; Person::Member::ValidAge::AgeRange::Maximum) return false;<br> retu=
rn true;<br>}</p><p>bool RegisterPerson(Person &person) { <br>&nbs=
p;if (!CanRegisterPerson(person)) {<br> printf("Cannot register =
person %s:%s, %s:%s because age %d must be in between %d and %d\n"<br> =
; ,person::Member::FirstName::MyAttribute::Name.c_str()<br> =
; ,person.FistName.c_str()<br> ,person::Member:=
:LastName::MyAttribute::Name.c_str()<br> ,person.LastName.=
c_str() <br> ,person.Age<br> &=
nbsp;,Person::Member::ValidAge::AgeRange::Minimum<br> ,Per=
son::Member::ValidAge::AgeRange::Maximum<br> return false;=
<br> );<br> return true; <br> }</p><p=
>}<br></p><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.=
8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-=
width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div><br></div><div=
><br></div><div><br></div><div><br></div><div><br></div></div></blockquote>=
</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_162_29231422.1398876328816--
.
Author: Peter Koch Larsen <peter.koch.larsen@gmail.com>
Date: Wed, 30 Apr 2014 21:15:50 +0200
Raw View
If you are not using the argument, I fail to see why you would want to
look at it in the debugger.
/Peter
On Wed, Apr 30, 2014 at 5:31 PM, <gmisocpp@gmail.com> wrote:
> Hi
>
>
> On Thursday, May 1, 2014 1:56:24 AM UTC+12, Jean-Marc Bourguet wrote:
>>
>> Le mercredi 30 avril 2014 14:59:51 UTC+2, gmis...@gmail.com a =C3=A9crit=
:
>>>
>>> btw. anyone think we're ready to add things like [[unused_arg]] yet?
>>>
>> We don't need an attribute for that, we already can avoid giving a name =
to
>> the argument.
>
>
> Not naming an argument is really undesirable, it means amongst other thin=
gs,
> you can't as easily look at the value of the argument in some debuggers.
> It's makes for poor documentation.
>
> I don't think we should accept the status quo on this.
>>
>>
>> Yours,
>>
>> --
>> Jean-Marc
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.
Author: gmisocpp@gmail.com
Date: Wed, 30 Apr 2014 13:37:49 -0700 (PDT)
Raw View
------=_Part_1353_12002955.1398890269483
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi
On Thursday, May 1, 2014 7:15:50 AM UTC+12, Peter Koch Larsen wrote:
>
> If you are not using the argument, I fail to see why you would want to=20
> look at it in the debugger.=20
>
> /Peter=20
>
You're not using it currently, it doesn't mean you don't intend to use it=
=20
later, you still want to verify that it has the right value should there=20
come a time when you want to use it, right?
And you'd still like to name it, because it makes the code more readable,=
=20
right?
You'd also like to make sure any documentation tools that use these names=
=20
have a name to work with, etc. etc. etc.
> On Wed, Apr 30, 2014 at 5:31 PM, <gmis...@gmail.com <javascript:>>=20
> wrote:=20
> > Hi=20
> >=20
> >=20
> > On Thursday, May 1, 2014 1:56:24 AM UTC+12, Jean-Marc Bourguet wrote:=
=20
> >>=20
> >> Le mercredi 30 avril 2014 14:59:51 UTC+2, gmis...@gmail.com a =C3=A9cr=
it :=20
> >>>=20
> >>> btw. anyone think we're ready to add things like [[unused_arg]] yet?=
=20
> >>>=20
> >> We don't need an attribute for that, we already can avoid giving a nam=
e=20
> to=20
> >> the argument.=20
> >=20
> >=20
> > Not naming an argument is really undesirable, it means amongst other=20
> things,=20
> > you can't as easily look at the value of the argument in some debuggers=
..=20
> > It's makes for poor documentation.=20
> >=20
> > I don't think we should accept the status quo on this.=20
> >>=20
> >>=20
> >> Yours,=20
> >>=20
> >> --=20
> >> Jean-Marc=20
> >=20
> > --=20
> >=20
> > ---=20
> > You received this message because you are subscribed to the Google=20
> Groups=20
> > "ISO C++ Standard - Future Proposals" group.=20
> > To unsubscribe from this group and stop receiving emails from it, send=
=20
> an=20
> > email to std-proposal...@isocpp.org <javascript:>.=20
> > To post to this group, send email to std-pr...@isocpp.org <javascript:>=
..=20
>
> > Visit this group at=20
> > http://groups.google.com/a/isocpp.org/group/std-proposals/.=20
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_1353_12002955.1398890269483
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi<br><br>On Thursday, May 1, 2014 7:15:50 AM UTC+12, Pete=
r Koch Larsen wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0px =
0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bo=
rder-left-width: 1px; border-left-style: solid;">If you are not using the a=
rgument, I fail to see why you would want to
<br>look at it in the debugger.
<br>
<br>/Peter
<br></blockquote><div><br></div><div>You're not using it currently, it does=
n't mean you don't intend to use it later, you still want to verify t=
hat it has the right value should there come a time when you want to use it=
, right?</div><div><br></div><div>And you'd still like to name it, because =
it makes the code more readable, right?</div><div><br></div><div>You'd also=
like to make sure any documentation tools that use these names have&n=
bsp;a name to work with, etc. etc. etc.</div><div><br></div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; b=
order-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-s=
tyle: solid;">
<br>On Wed, Apr 30, 2014 at 5:31 PM, <<a onmousedown=3D"this.href=
=3D'javascript:';return true;" onclick=3D"this.href=3D'javascript:';return =
true;" href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"rrpE=
Vzkvy6YJ">gmis...@gmail.com</a>> wrote:
<br>> Hi
<br>>
<br>>
<br>> On Thursday, May 1, 2014 1:56:24 AM UTC+12, Jean-Marc Bourguet wro=
te:
<br>>>
<br>>> Le mercredi 30 avril 2014 14:59:51 UTC+2, <a>gmis...@gmail.com=
</a> a =C3=A9crit :
<br>>>>
<br>>>> btw. anyone think we're ready to add things like [[unused_=
arg]] yet?
<br>>>>
<br>>> We don't need an attribute for that, we already can avoid givi=
ng a name to
<br>>> the argument.
<br>>
<br>>
<br>> Not naming an argument is really undesirable, it means amongst oth=
er things,
<br>> you can't as easily look at the value of the argument in some debu=
ggers.
<br>> It's makes for poor documentation.
<br>>
<br>> I don't think we should accept the status quo on this.
<br>>>
<br>>>
<br>>> Yours,
<br>>>
<br>>> --
<br>>> Jean-Marc
<br>>
<br>> --
<br>>
<br>> ---
<br>> You received this message because you are subscribed to the Google=
Groups
<br>> "ISO C++ Standard - Future Proposals" group.
<br>> To unsubscribe from this group and stop receiving emails from it, =
send an
<br>> email to <a onmousedown=3D"this.href=3D'javascript:';return true;"=
onclick=3D"this.href=3D'javascript:';return true;" href=3D"javascript:" ta=
rget=3D"_blank" gdf-obfuscated-mailto=3D"rrpEVzkvy6YJ">std-proposal...@<wbr=
>isocpp.org</a>.
<br>> To post to this group, send email to <a onmousedown=3D"this.href=
=3D'javascript:';return true;" onclick=3D"this.href=3D'javascript:';return =
true;" href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"rrpE=
Vzkvy6YJ">std-pr...@isocpp.org</a>.
<br>> Visit this group at
<br>> <a onmousedown=3D"this.href=3D'http://groups.google.com/a/isocpp.o=
rg/group/std-proposals/';return true;" onclick=3D"this.href=3D'http://group=
s.google.com/a/isocpp.org/group/std-proposals/';return true;" href=3D"http:=
//groups.google.com/a/isocpp.org/group/std-proposals/" target=3D"_blank">ht=
tp://groups.google.com/a/<wbr>isocpp.org/group/std-<wbr>proposals/</a>.
<br></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_1353_12002955.1398890269483--
.
Author: maksimpustovoyt@gmail.com
Date: Wed, 30 Apr 2014 17:43:10 -0700 (PDT)
Raw View
------=_Part_2930_9961398.1398904990735
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wednesday, April 30, 2014 8:13:44 AM UTC-4, Klaim - Jo=C3=ABl Lamotte wr=
ote:
>
> C++11 already have =E2=80=8Battributes. See:=20
> en.cppreference.com/w/cpp/language/attributes
> Or are you suggesting specific attributes to be standardised?
> If yes, then your example is not clear at all to me.
>
This is different than C++11 attributes.
This is extendable Metadata about class which you can use in real time=20
or sometimes it's called "reflection"
For example, I want to print my object in nice format. I can do something=
=20
like that:
*[AttributeExtension]* // This predefine attribute tells compiler that this=
=20
class can be used as an Attribute for other classes:
struct MyAttribute {
string Name;
string Description;
MyAttribute(string name; string description=3D "") : Name(name),=20
Description(description) {}
}
*[AttributeExtension]* // This predefine attribute tells compiler that this=
=20
class can be used as an Attribute for other classes:
struct AgeRange {=20
int Minum;
int Maximum;
AgeRange(int minum; int maximum) Minum(minum), Maximum(maximum) {}
}
.... some time later in code...
*[METADATA(true)]* // tells compiler to geneate meta data about class Perso=
n
// Compiler generates static Metadata=20
classes such as Person::Class::MyAttribute,=20
Person::Member::FirstName::MyAttribute, ...
*[MyAttribute("Person", "Person Info")]* // calls constructor=20
Person::Class::MyAttribute::MyAttribute("Person", "Person Info")
struct Person {
[MyAttribute("Fist Name")] // calls constructor=20
Person::Member:FirstName::MyAttribute::MyAttribute("Fist Name")
string FirstName;
[MyAttribute("Last Name", "Person's last name")] // calls=20
constructor Person::Member:FirstName::MyAttribute::MyAttribute("Last Name",=
=20
"Person's last name")=20
string LastName;
[AgeRange(18,50)] // calls constructorPerson::Member::
AgeRange::AgeRange(18,50)=20
int ValidAge;
}
.... some time later in code...
bool CanRegisterPerson(Person &person) {=20
if (person.ValidAge < *Person::Member::ValidAge::AgeRange::Minimum*)=20
return false;=20
if (person.ValidAge > *Person::Member::ValidAge::AgeRange::Maximum*)=20
return false;
return true;
}
bool RegisterPerson(Person &person) {=20
if (!CanRegisterPerson(person)) {
printf("Cannot register person %s:%s, %s:%s because age %d must be in=20
between %d and %d\n"
,*Person::Member::FirstName::MyAttribute::Name*.c_str() // compiler=20
generate static data member Name ()
,person.FistName.c_str()
,*Person::Member::LastName::MyAttribute::Name*.c_str()
,person.LastName.c_str() =20
,person.Age
,*Person::Member::ValidAge::AgeRange::Minimum*
,*Person::Member::ValidAge::AgeRange::Maximum*
return false;
);
return true; =20
}
}=20
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_2930_9961398.1398904990735
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Wednesday, April 30, 2014 8:13:44 AM UTC-4, Kla=
im - Jo=C3=ABl Lamotte wrote:<blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204,=
204); border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr">=
C++11 already have =E2=80=8Battributes. See: <a onmousedown=3D"th=
is.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fen.cppreference.com%2=
Fw%2Fcpp%2Flanguage%2Fattributes\46sa\75D\46sntz\0751\46usg\75AFQjCNH9Dk3GS=
NX7l_TUTRgP10mO8NSFVQ';return true;" onclick=3D"this.href=3D'http://www.goo=
gle.com/url?q\75http%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Flanguage%2Fatt=
ributes\46sa\75D\46sntz\0751\46usg\75AFQjCNH9Dk3GSNX7l_TUTRgP10mO8NSFVQ';re=
turn true;" href=3D"http://en.cppreference.com/w/cpp/language/attributes" t=
arget=3D"_blank">en.cppreference.com/w/<wbr>cpp/language/attributes</a><div=
>Or are you suggesting specific attributes to be standardised?<div>
If yes, then your example is not clear at all to me.</div></div></div></blo=
ckquote><div><div><br>This is different than C++11 attributes.</div><p>This=
is extendable Metadata about class which you can use in real time or =
sometimes it's called "reflection"</p><p>For example, I want to print =
my object in nice format. I can do something like that:</p><p><strong>[Attr=
ibuteExtension]</strong> <font color=3D"#38761d">// This predefine attribut=
e tells compiler that this class can be used as an Attribute for other clas=
ses:</font><br>struct MyAttribute {<br> string Name;<br>&=
nbsp; string Description;<br> MyAttribute(str=
ing name; string description=3D "") : Name(name), Description(description) =
{}<br>}<br><strong>[AttributeExtension]</strong> <font color=3D"#38761d">//=
This predefine attribute tells compiler that this class can be used as an =
Attribute for other classes:</font><br>struct AgeRange { <br> &nb=
sp; int Minum;<br> int Maximum;<br> AgeRange(int minum; int=
maximum) Minum(minum), Maximum(maximum) {}<br>}</p><p><br></p><div><=
font color=3D"#134f5c">... some time later in code...</font></div><font col=
or=3D"#134f5c"></font><div><br><strong>[METADATA(true)]</strong> <font colo=
r=3D"#38761d">// tells compiler to geneate meta data about class Person</fo=
nt></div><div><font color=3D"#38761d"> &=
nbsp; &nbs=
p; &=
nbsp; // Compiler generates static Metadata classes such as <font colo=
r=3D"#38761d"><font color=3D"#38761d">Person::Class::MyAttribute, Person::M=
ember::FirstName::MyAttribute, ...</font></font></font></div><div><font col=
or=3D"#38761d"></font><br><strong>[MyAttribute("Person", "Person Info")]</s=
trong> <font color=3D"#6aa84f">// calls constructor Person::Class::MyAttrib=
ute::MyAttribute("<wbr>Person", "Person Info")</font><br>struct Person {<br=
> [MyAttribute("Fist Name")] <font color=3D"#6aa84f">// calls construc=
tor Person::Member:FirstName::MyAttribute::MyAttribute("Fist Name")</font><=
br> string FirstName;<br> [MyAttribute("Last Name", "Person's las=
t name")] <font color=3D"#6aa84f">// calls constructor Person::Member:=
FirstName::MyAttribute::MyAttribute("Last Name", "Person's last name")</fon=
t> <br> string LastName;<br> [AgeRange(18,50)]<font color=3D=
"#38761d"> // calls constructor<font color=3D"#6aa84f">Person::Member::</fo=
nt>AgeRange::AgeRange(18,50)</font> <br> int ValidAge;<br>}</div>=
<p><br><font color=3D"#0b5394">... some time later in code...</font></p><p>=
bool CanRegisterPerson(Person &person) { <br> if (person.Vali=
dAge < <strong>Person::Member::ValidAge::<wbr>AgeRange::Minimum</strong>=
) return false; <br> if (person.ValidAge > <strong>Person::Mem=
ber::ValidAge::<wbr>AgeRange::Maximum</strong>) return false;<br> retu=
rn true;<br>}</p><p>bool RegisterPerson(Person &person) { <br>&nbs=
p;if (!CanRegisterPerson(person)) {<br> printf("Cannot register =
person %s:%s, %s:%s because age %d must be in between %d and %d\n"<br> =
; ,<strong>Person::Member::FirstName:<wbr>:MyAttribute::Name</st=
rong>.c_str() // compiler generate static data member Name ()<br>=
,person.FistName.c_str()<br> ,<strong>Pe=
rson::Member::LastName::<wbr>MyAttribute::Name</strong>.c_str()<br> &n=
bsp; ,person.LastName.c_str() <br> ,=
person.Age<br> ,<strong>Person::Member::ValidAge::<wbr>Age=
Range::Minimum</strong><br> ,<strong>Person::Member::Valid=
Age::<wbr>AgeRange::Maximum</strong><br> return false;<br>=
);<br> return true; <br> }</p><p><br=
></p><p><br></p><p>} </p></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_2930_9961398.1398904990735--
.
Author: David Krauss <potswa@gmail.com>
Date: Thu, 1 May 2014 10:46:15 +0800
Raw View
--Apple-Mail=_C2E800FD-A521-4CC8-A1FD-2982EFA9F530
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1
On 2014-05-01, at 4:37 AM, gmisocpp@gmail.com wrote:
> Hi
>=20
> On Thursday, May 1, 2014 7:15:50 AM UTC+12, Peter Koch Larsen wrote:
> If you are not using the argument, I fail to see why you would want to=20
> look at it in the debugger.=20
>=20
> /Peter=20
>=20
> You're not using it currently, it doesn't mean you don't intend to use i=
t later, you still want to verify that it has the right value should there =
come a time when you want to use it, right?
The debugger is likely to reuse the storage for something else, due to the =
variable having no lifetime, so it wouldn't be able to show the value for v=
ery long. Anyway, there's no reason to suppress warnings in unfinished code=
.. If you intend to use something in the near future, you wouldn't mark it [=
[unused]] because the warning serves as a useful reminder.
> You'd also like to make sure any documentation tools that use these names=
have a name to work with, etc. etc. etc.
Such documentation is based on interface declarations, not implementation.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--Apple-Mail=_C2E800FD-A521-4CC8-A1FD-2982EFA9F530
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-=
mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 2014&=
ndash;05–01, at 4:37 AM, <a href=3D"mailto:gmisocpp@gmail.com">gmisoc=
pp@gmail.com</a> wrote:</div><br class=3D"Apple-interchange-newline"><block=
quote type=3D"cite"><div dir=3D"ltr">Hi<br><br>On Thursday, May 1, 2014 7:1=
5:50 AM UTC+12, Peter Koch Larsen wrote:<blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rg=
b(204, 204, 204); border-left-width: 1px; border-left-style: solid;">If you=
are not using the argument, I fail to see why you would want to
<br>look at it in the debugger.
<br>
<br>/Peter
<br></blockquote><div><br></div><div>You're not using it currently, it does=
n't mean you don't intend to use it later, you still want to verify t=
hat it has the right value should there come a time when you want to use it=
, right?</div></div></blockquote><div><br></div><div>The debugger is likely=
to reuse the storage for something else, due to the variable having no lif=
etime, so it wouldn’t be able to show the value for very long. Anyway=
, there’s no reason to suppress warnings in unfinished code. If you i=
ntend to use something in the near future, you wouldn’t mark it [[unu=
sed]] because the warning serves as a useful reminder.</div><br><blockquote=
type=3D"cite"><div dir=3D"ltr"><div>You'd also like to make sure any docum=
entation tools that use these names have a name to work with, etc=
.. etc. etc.</div></div></blockquote><div><br></div>Such documentation is ba=
sed on interface declarations, not implementation.</div><div><br></div></bo=
dy></html>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--Apple-Mail=_C2E800FD-A521-4CC8-A1FD-2982EFA9F530--
.
Author: David Krauss <potswa@gmail.com>
Date: Thu, 1 May 2014 12:23:48 +0800
Raw View
On 2014-05-01, at 10:46 AM, David Krauss <potswa@gmail.com> wrote:
> The debugger is likely to reuse the storage for something else
Er, the compiler directs the program to reuse the storage, and the debugger is at the mercy of the compiled binary.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: douglas.boffey@gmail.com
Date: Thu, 1 May 2014 03:04:44 -0700 (PDT)
Raw View
------=_Part_93_18596084.1398938684635
Content-Type: text/plain; charset=UTF-8
I would like to see a compiler not even generate code to pass arguments
marked as [[unused]]. There are two places where [[unused]] is necessary,
and that is with the postincrement and postdecrement operators.
The parameter cannot automatically purge the parameter, as a function may
be (perversely) called by
operator++(a, b).
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_93_18596084.1398938684635
Content-Type: text/html; charset=UTF-8
<div dir="ltr"><DIV>I would like to see a compiler not even generate code to pass arguments marked as [[unused]]. There are two places where [[unused]] is necessary, and that is with the postincrement and postdecrement operators.</DIV>
<DIV> </DIV>
<DIV>The parameter cannot automatically purge the parameter, as a function may be (perversely) called by</DIV>
<DIV>operator++(a, b).</DIV></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />
------=_Part_93_18596084.1398938684635--
.
Author: gmisocpp@gmail.com
Date: Thu, 1 May 2014 05:03:18 -0700 (PDT)
Raw View
------=_Part_5011_32858850.1398945798559
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi
On Thursday, May 1, 2014 2:46:15 PM UTC+12, David Krauss wrote:
>
>
> On 2014=E2=80=9305=E2=80=9301, at 4:37 AM, gmis...@gmail.com <javascript:=
> wrote:
>
> Hi
>
> On Thursday, May 1, 2014 7:15:50 AM UTC+12, Peter Koch Larsen wrote:
>>
>> If you are not using the argument, I fail to see why you would want to=
=20
>> look at it in the debugger.=20
>>
>> /Peter=20
>>
>
> You're not using it currently, it doesn't mean you don't intend to use i=
t=20
> later, you still want to verify that it has the right value should there=
=20
> come a time when you want to use it, right?
>
>
> The debugger is likely to reuse the storage for something else, due to th=
e=20
> variable having no lifetime, so it wouldn=E2=80=99t be able to show the v=
alue for=20
> very long. Anyway, there=E2=80=99s no reason to suppress warnings in unfi=
nished=20
> code. If you intend to use something in the near future, you wouldn=E2=80=
=99t mark=20
> it [[unused]] because the warning serves as a useful reminder.
>
I don't know what you mean by "very long", the debugger I use always seems=
=20
to show me the value of a parameter if I've named it adequately enough.
The problems appear when I remove the name of it, which is exactly why I=20
don't find that a good solution.
The warning as a useful reminder is reasonable enough opinion, but it isn't=
=20
something every person shares or every compiler agrees on anyway. Plenty of=
=20
companies like to see release builds warning free, for example, rightly or=
=20
wrongly.
Which is the whole problem with the current solution set. There isn't any=
=20
standard way to gain control over these issues.
I think we have to discuss things in the context of what do we want to=20
achieve. This discussion just tells me that we might need more than one=20
attribute rather than no control.
I also don't find removing the parameter name from the definition a great=
=20
solution to stating a parameter is "unused", even if the name is in the=20
header. If as a developer, I'm looking at the definition, I don't want to=
=20
have to go to the header to remind myself what the parameter is.
Nor do I want a whole lot of uncertainty about what the compiler might do=
=20
with an unused parameter. Can it go as far as removing it completely and=20
changing an interface for example.
So we might need more than one attribute to control that. Not one. i.e.=20
[[not_used, warning or no_warning]], [[never_ever_will_be_used, no_warning]=
]
whatever.
> You'd also like to make sure any documentation tools that use these names=
=20
> have a name to work with, etc. etc. etc.
>
>
> Such documentation is based on interface declarations, not implementation=
..
>
>
Documentation tools can use such attributes too so that it can see a=20
parameter is currently unused or never used or whatever, a doc tool could=
=20
be aware of that without some code analysis to discover the fact.
There is definitely room for improvements here. I just think it's not quite=
=20
so easy to work which is probably why it hasn't been done. But we also=20
never had the opportunity to abuse attributes to "help" things here before!
That's why the [[warn_on_unused_return]] type one was the one I chose=20
first, because it seems easiest to specify. But It'd be nice to nail down=
=20
some [[unused_arg]] type attributes that would work.
Thanks
=20
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_5011_32858850.1398945798559
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi<br><br>On Thursday, May 1, 2014 2:46:15 PM UTC+12, Davi=
d Krauss wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0=
px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-=
left-width: 1px; border-left-style: solid;"><div style=3D"-ms-word-wrap: br=
eak-word;"><br><div><div>On 2014=E2=80=9305=E2=80=9301, at 4:37 AM, <a onmo=
usedown=3D"this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'=
javascript:';return true;" href=3D"javascript:" target=3D"_blank" gdf-obfus=
cated-mailto=3D"qm9o0iEPucwJ">gmis...@gmail.com</a> wrote:</div><br><blockq=
uote type=3D"cite"><div dir=3D"ltr">Hi<br><br>On Thursday, May 1, 2014 7:15=
:50 AM UTC+12, Peter Koch Larsen wrote:<blockquote class=3D"gmail_quote" st=
yle=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb=
(204, 204, 204); border-left-width: 1px; border-left-style: solid;">If you =
are not using the argument, I fail to see why you would want to
<br>look at it in the debugger.
<br>
<br>/Peter
<br></blockquote><div><br></div><div>You're not using it currently, it does=
n't mean you don't intend to use it later, you still want to verify t=
hat it has the right value should there come a time when you want to use it=
, right?</div></div></blockquote><div><br></div><div>The debugger is likely=
to reuse the storage for something else, due to the variable having no lif=
etime, so it wouldn=E2=80=99t be able to show the value for very long. Anyw=
ay, there=E2=80=99s no reason to suppress warnings in unfinished code. If y=
ou intend to use something in the near future, you wouldn=E2=80=99t mark it=
[[unused]] because the warning serves as a useful reminder.</div></div></d=
iv></blockquote><div><br></div><div>I don't know what you mean by "ver=
y long", the debugger I use always seems to show me the value of a paramete=
r if I've named it adequately enough.</div><div>The problems appear when I =
remove the name of it, which is exactly why I don't find that a good soluti=
on.</div><div><br></div><div>The warning as a useful reminder is reasonable=
enough opinion, but it isn't something every person shares or every c=
ompiler agrees on anyway. Plenty of companies like to see release builds wa=
rning free, for example, rightly or wrongly.</div><div><br></div><div>Which=
is the whole problem with the current solution set. There isn't any standa=
rd way to gain control over these issues.</div><div>I think we have to disc=
uss things in the context of what do we want to achieve. This discussion ju=
st tells me that we might need more than one attribute rather than no contr=
ol.</div><div><br></div><div>I also don't find removing the parameter name =
from the definition a great solution to stating a parameter is "unused", ev=
en if the name is in the header. If as a developer, I'm looking at the=
definition, I don't want to have to go to the header to remind myself=
what the parameter is.</div><div><br></div><div>Nor do I want a =
whole lot of uncertainty about what the compiler might do with an unused pa=
rameter. Can it go as far as removing it completely and changing an interfa=
ce for example.</div><div><br></div><div>So we might need more than one att=
ribute to control that. Not one. i.e. [[not_used, warning or no_warning]], =
[[never_ever_will_be_used, no_warning]]</div><div>whatever.</div><div><br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; =
padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width=
: 1px; border-left-style: solid;"><div style=3D"-ms-word-wrap: break-word;"=
><div><br><blockquote type=3D"cite"><div dir=3D"ltr"><div>You'd also like t=
o make sure any documentation tools that use these names have a n=
ame to work with, etc. etc. etc.</div></div></blockquote><div><br></div>Suc=
h documentation is based on interface declarations, not implementation.</di=
v><div><br></div></div></blockquote><div><br></div><div>Documentation tools=
can use such attributes too so that it can see a parameter is current=
ly unused or never used or whatever, a doc tool could be aware of that with=
out some code analysis to discover the fact.</div><div><br></div><div>There=
is definitely room for improvements here. I just think it's not quite so e=
asy to work which is probably why it hasn't been done. But we also nev=
er had the opportunity to abuse attributes to "help" things here before!</d=
iv><div><br></div><div>That's why the [[warn_on_unused_return]] type o=
ne was the one I chose first, because it seems easiest to specify. But It'd=
be nice to nail down some [[unused_arg]] type attributes that would =
work.</div><div><br></div><div>Thanks</div><div> </div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_5011_32858850.1398945798559--
.
Author: Peter Koch Larsen <peter.koch.larsen@gmail.com>
Date: Thu, 1 May 2014 14:41:10 +0200
Raw View
On 4/30/14, gmisocpp@gmail.com <gmisocpp@gmail.com> wrote:
> Hi
>
> On Thursday, May 1, 2014 7:15:50 AM UTC+12, Peter Koch Larsen wrote:
>>
>> If you are not using the argument, I fail to see why you would want to
>> look at it in the debugger.
>>
>> /Peter
>>
>
> You're not using it currently, it doesn't mean you don't intend to use it
> later, you still want to verify that it has the right value should there
> come a time when you want to use it, right?
But then you use it! As mentioned elsewhere, it is likely that
compilers optimise stuff away for unused variables. So assume
(nontested code so beware)
int foo(int i, int, int k) { return i + k; }
....
foo(3,4,5);
A good guess is that this code generates the same binary as would
int foo(int i, int k) { return i + k; }
....
foo(3,5);
>
> And you'd still like to name it, because it makes the code more readable,
> right?
>
You can name the variables in the declaration. It is in the definition
you omit the names.
There you will likely need a comment anyway.
/Peter
[snip]
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: gmisocpp@gmail.com
Date: Thu, 1 May 2014 18:10:16 -0700 (PDT)
Raw View
------=_Part_319_19703855.1398993016869
Content-Type: text/plain; charset=UTF-8
Before it gets lost in the mix. I mentioned this to begin with:
> I'd quite like to see [[warn_unused_result]] become standard.
>
I really am quite keen to drum up support for that. I appreciate there
might not be consensus for other things like [[unused_arg]],
but [[warn_unused_result]] seems really useful and hard to find fault with
(I'm going to regret saying that, right)
Things like empty() in std::string really benefit from that. It would be
nice for other code to gain from it and become standard.
Any takers with [[warn_unused_result]] ?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_319_19703855.1398993016869
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Before it gets lost in the mix. I mentioned this to b=
egin with:</div><div> </div><blockquote class=3D"gmail_quote" style=3D=
"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, =
204, 204); border-left-width: 1px; border-left-style: solid;"><div dir=3D"l=
tr"><div>I'd quite like to see [[warn_unused_result]] become standard.=
<br></div></div></blockquote><div><br></div><div>I really am quite keen to =
drum up support for that. I appreciate there might not be consensus for oth=
er things like [[unused_arg]],</div><div>but [[warn_unused_result]] seems r=
eally useful and hard to find fault with (I'm going to regret saying that, =
right)</div><div><br></div><div>Things like empty() in std::string really b=
enefit from that. It would be nice for other code to gain from it and becom=
e standard.</div><div><br></div><div>Any takers with [[warn_unused_res=
ult]] ?</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_319_19703855.1398993016869--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Mon, 05 May 2014 10:12:58 -0700
Raw View
Em seg 05 maio 2014, =E0s 04:44:29, masse.nicolas@gmail.com escreveu:
> Right now, there is already a study group wich is working on reflection. =
It=20
> seems that they're mainly working on compile-time reflection capabilities=
,
> which is for me the right way of doing thing in C++.
The discussion is that any runtime reflection should be based on top of a=
=20
compile-time reflection, so it has to come first. Obviously, it needs to be=
=20
tested with a proof-of-concept runtime implementation to see that one can b=
e=20
built.
--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.
Author: Cleiton Santoia <cleitonsantoia@gmail.com>
Date: Wed, 7 May 2014 16:58:53 -0700 (PDT)
Raw View
------=_Part_53_18543726.1399507133914
Content-Type: text/plain; charset=UTF-8
Completing what Tiago Macieira said, we are already working in this issue
and just posted a new topic on C++ attributes in another forum about this
thing called "reflection" :), please continue the discussion there C++
Attributes Topic<https://groups.google.com/a/isocpp.org/forum/?fromgroups#!topic/reflection/Fkqdg0puSb0>
Thanks
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_53_18543726.1399507133914
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><br></div><div><br></div><div><div>Completing what Ti=
ago Macieira said, we are already working in this issue and just posted a n=
ew topic on C++ attributes in another forum about this thing called "reflec=
tion" :), please continue the discussion there <a href=3D"https://grou=
ps.google.com/a/isocpp.org/forum/?fromgroups#!topic/reflection/Fkqdg0puSb0"=
>C++ Attributes Topic</a></div><div><br></div><div>Thanks</div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_53_18543726.1399507133914--
.