is_dereferenceable.hpp fails to compile with Apple Clang 3.0

Hi All, I am trying to use boost::iostreams. When I include boost/iostreams/filtering_streambuf.hpp (even if I don't declare any filtering_streambuf variables) I get the following compilation error: is_dereferencable.hpp: Parse Issue: Expected unqualified-id The problem is in this code: template <class T> struct impl { static typename boost::remove_cv<T>::type& x; BOOST_STATIC_CONSTANT( bool , value = sizeof(is_dereferenceable_::check BOOST_PREVENT_MACRO_SUBSTITUTION(BOOST_comma(*x,0))) == 1 ); }; Compiler: Apple Clang 3.0, with -std=c++0x flag Any help would be greatly appreciated. Thanks Istvan

AMDG On 12/11/2011 02:26 PM, István Csanády wrote:
I am trying to use boost::iostreams. When I include boost/iostreams/filtering_streambuf.hpp (even if I don't declare any filtering_streambuf variables) I get the following compilation error: is_dereferencable.hpp: Parse Issue: Expected unqualified-id
The problem is in this code:
template <class T> struct impl { static typename boost::remove_cv<T>::type& x;
BOOST_STATIC_CONSTANT( bool , value = sizeof(is_dereferenceable_::check BOOST_PREVENT_MACRO_SUBSTITUTION(BOOST_comma(*x,0))) == 1 ); };
Compiler: Apple Clang 3.0, with -std=c++0x flag
Any help would be greatly appreciated.
This is because of Apple's evil #define check(x) In Christ, Steven Watanabe

I have removed the BOOST_STATIC_CONSTANT macro and made the
substitution by hand but is there any workaround to make this work
without modifying boost headers?
On Mon, Dec 12, 2011 at 2:01 AM, Steven Watanabe
AMDG
On 12/11/2011 02:26 PM, István Csanády wrote:
I am trying to use boost::iostreams. When I include boost/iostreams/filtering_streambuf.hpp (even if I don't declare any filtering_streambuf variables) I get the following compilation error: is_dereferencable.hpp: Parse Issue: Expected unqualified-id
The problem is in this code:
template <class T> struct impl { static typename boost::remove_cv<T>::type& x;
BOOST_STATIC_CONSTANT( bool , value = sizeof(is_dereferenceable_::check BOOST_PREVENT_MACRO_SUBSTITUTION(BOOST_comma(*x,0))) == 1 ); };
Compiler: Apple Clang 3.0, with -std=c++0x flag
Any help would be greatly appreciated.
This is because of Apple's evil #define check(x)
In Christ, Steven Watanabe _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On Mon, Dec 12, 2011 at 2:01 AM, Steven Watanabe
wrote: This is because of Apple's evil #define check(x)
On 12 December 2011 01:16, István Csanády
I have removed the BOOST_STATIC_CONSTANT macro and made the substitution by hand but is there any workaround to make this work without modifying boost headers?
If possible, it's best to avoid the problematic Apple header. If not
try either including the boost headers before the apple headers or
undefining check before including boost:
#if defined(check)
#undef check
#endif
#include

On Dec 12, 2011, at 3:19 AM, Daniel James wrote:
On Mon, Dec 12, 2011 at 2:01 AM, Steven Watanabe
wrote: This is because of Apple's evil #define check(x)
On 12 December 2011 01:16, István Csanády
wrote: I have removed the BOOST_STATIC_CONSTANT macro and made the substitution by hand but is there any workaround to make this work without modifying boost headers?
If possible, it's best to avoid the problematic Apple header. If not try either including the boost headers before the apple headers or undefining check before including boost:
#if defined(check) #undef check #endif
#include
Since the problematic code is in an implementation detail, I think we can fix this for the next version of boost by renaming 'check'.
Or define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 in your Jamfile. -- Marshall Marshall Clow Idio Software mailto:mclow.lists@gmail.com A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki
participants (4)
-
Daniel James
-
István Csanády
-
Marshall Clow
-
Steven Watanabe