Topic: Checking C++0X support
Author: Helmut Jarausch <jarausch@igpm.rwth-aachen.de>
Date: Mon, 11 Apr 2011 13:28:43 CST Raw View
Hi,
for some time, some compilers won't support the (full) C++0X standard.
For an even longer time, software won't require the usage of such a
compiler, but also don't want to preclude taking advantage of the new
features if such a compiler is used.
So, there is need for a portable compile time check for C++0X support.
Is there something like this?
Many thanks,
Helmut.
--
Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
[ 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: Pete Becker <pete@versatilecoding.com>
Date: Tue, 12 Apr 2011 13:09:32 CST Raw View
On 2011-04-11 09:28:43 -0400, Helmut Jarausch said:
> for some time, some compilers won't support the (full) C++0X standard.
> For an even longer time, software won't require the usage of such a
> compiler, but also don't want to preclude taking advantage of the new
> features if such a compiler is used.
> So, there is need for a portable compile time check for C++0X support.
> Is there something like this?
>
>
Compilers that conform to the C++0x specification will define the macro
__cplusplus with the value 201103L. Compilers that do not conform to the
C++0x specification are not constrained by the C++0x specification (duh),
but, hopefully, won't do that.
--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference (
www.petebecker.com/tr1book)
[ 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: =3D?UTF-8?B?RGFuaWVsIEtyw7xnbGVy?=3D <daniel.kruegler@googlemail.com>
Date: Tue, 12 Apr 2011 13:10:19 CST Raw View
Am 11.04.2011 21:28, schrieb Helmut Jarausch:
>
> Hi,
>
> for some time, some compilers won't support the (full) C++0X standard.
> For an even longer time, software won't require the usage of such a
> compiler, but also don't want to preclude taking advantage of the new
> features if such a compiler is used.
> So, there is need for a portable compile time check for C++0X support.
> Is there something like this?
>
The standard provides a solution for this: As of [cpp.predefined] it define=
s
the predefined macro name
__cplusplus
(with two leading underscores) and describes:
"The name __cplusplus is defined to the value 201103L when compiling a C++
translation unit. (footnote 157)"
where the (non-normative) footnote 157 says:
"It is intended that future versions of this standard will replace the valu=
e
of this macro with a greater value. Non-conforming compilers should use a
value with at most five decimal digits."
This is a recommendation, so some compiler might (do) not follow this
advice, so. But I think, that q.o.i will ensure that serious compiler will
try to conform, if they currently don't do.
HTH & Greetings from Bremen,
Daniel Kr=FCgler
--
[ 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: CornedBee <wasti.redl@gmx.net>
Date: Tue, 12 Apr 2011 13:11:38 CST Raw View
On Apr 11, 9:28 pm, Helmut Jarausch <jarau...@igpm.rwth-aachen.de>
wrote:
> Hi,
>
> for some time, some compilers won't support the (full) C++0X standard.
> For an even longer time, software won't require the usage of such a
> compiler, but also don't want to preclude taking advantage of the new
> features if such a compiler is used.
> So, there is need for a portable compile time check for C++0X support.
> Is there something like this?
I think your best bet is Boost's config system, which is tries to
support as many compilers as possible.
Sebastian
--
[ 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 ]