>From: "Paul Mensonides" <[EMAIL PROTECTED]> > From: "Daniel Frey" <[EMAIL PROTECTED]> > > > On Thu, 09 Jan 2003 20:18:08 +0100, Derek Ross wrote: > > > > > Daniel Frey wrote: > > >> Uhm... don't know about MPL, but isn't this a good example for > > >> type_traits? Something like: > > >> > > >> template <class T> > > >> bool SetOption(COptionInfo& o, const char* key, const T& value) { > > >> BOOST_STATIC_ASSERT( boost::is_same< T, bool >::value || > > >> boost::is_same< T, int >::value || > > >> boost::is_same< T, double >::value || > > >> boost::is_same< T, std::string >::value ); > > >> ...etc... > > > > > > It doesn't compile because the commas in the is_same template confuse > > > the macro preprocessor. > > > > > > The error message is: > > > > > > "macro "BOOST_STATIC_ASSERT" passed 5 arguments, but takes just 1" > > You can just do this as well: > > BOOST_STATIC_ASSERT( > ( boost::is_same<T, bool>::value ) || > ( boost::is_same<T, int>::value ) || > ( boost::is_same<T, double>::value ) || > ( boost::is_same<T, std::string>::value ); > ) > > In other words, just parenthesize the expressions.
Or even just the macro parameter: BOOST_STATIC_ASSERT((\ boost::is_same<T, bool>::value ||\ boost::is_same<T, int>::value ||\ boost::is_same<T, double>::value ||\ boost::is_same<T, std::string>::value )); Regards, Terje _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost