Topic: Why is there no standardized "pure" attribute in C++11?


Author: snk_kid <korcan.hussein@googlemail.com>
Date: Sun, 11 Mar 2012 23:14:36 -0700 (PDT)
Raw View
There is only 2-3 standardized C++11 attributes while more can be
added as vendor extensions but I'm surprised something like GCC pure/
const attributes where not standardized and left to vendor extensions.

Some kind of standardized mechanism (either via attributes or another
way) to define functions as pure/referentially transparent is highly
valuable for a number of reasons. You could say use consexpr but I may
not want a function to be evaluated at compile-time (if the context
allows for it).


--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]




Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?=<daniel.kruegler@googlemail.com>
Date: Mon, 12 Mar 2012 09:16:57 -0700 (PDT)
Raw View
On 2012-03-12 07:14, snk_kid wrote:
>  There is only 2-3 standardized C++11 attributes while more can be
>  added as vendor extensions but I'm surprised something like GCC pure/
>  const attributes where not standardized and left to vendor extensions.

The simple answer is: Lack of time and resources. There is no doubt that
there exists a bunch of useful attributes that could be standardized.
Nonetheless you need to invest a lot of energy into defining the right
normative wording for them and to ensure that they are implementable.

I can only recommend to write up a proposal and publish it e.g. in this
newsgroup. If the proposal is useful there is a good chance that someone
will forward it to the C++ committee, because currently there is some
work in progress for the next standard version.

HTH&  Greetings from Bremen,

Daniel Kr   gler


--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]