stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Lemings" <Eric.Lemi...@roguewave.com>
Subject _RWSTD_NO_EXT_CXX_0X Include Check
Date Mon, 16 Jun 2008 16:48:30 GMT
 
This is part of the <type_traits> header:

	$TOPDIR/include/type_traits:
	  ...
	  30 #ifndef _RWSTD_TYPE_TRAITS_INCLUDED
	  31 #define _RWSTD_TYPE_TRAITS_INCLUDED
	  32
	  33 #include <rw/_defs.h>
	  34
	  35 #ifdef _RWSTD_NO_EXT_CXX_0X
	  36 #  error _RWSTD_NO_EXT_CXX_0X defined and C++0x header
included
	  37 #endif
	  ...

Shouldn't lines 35-37 come before line 30 so the header isn't even
parsed if there is an include error?  In other words:
 
	...
	#ifdef _RWSTD_NO_EXT_CXX_0X
	#  error _RWSTD_NO_EXT_CXX_0X defined and C++0x header included
	#endif

	#ifndef _RWSTD_TYPE_TRAITS_INCLUDED
	#define _RWSTD_TYPE_TRAITS_INCLUDED

	#include <rw/_defs.h>
	...

It doesn't look conventional but, technically, it is slightly more
efficient.

Brad.

Mime
View raw message