Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-08 12:33:09

From: "Craig Henderson" <cdm.henderson_at_[hidden]>

> I have a problem with the BOOST_STATIC_ASSERT macros on VC++.Net. My


> Please could someone explain this behaviour? Am I missing something or
> something wrong with the macro or vc++ compatibility?

Expressions passed to BOOST_STATIC_ASSERT can only be compile-time
expressions (thus the word STATIC in the name), but typeid() is a runtime
expression. If you want a runtime assert, use <cassert>. If you want to
assert that types are the same at compile-time, try:

  #include <boost/type_traits.hpp>


        boost::is_same<typename Res::value_type, diff_result<T>*>::value));

or if you want equivalent behavior to your typeid() expression:

            typename boost::remove_cv<
                typename boost::remove_reference<
                    typename Res::value_type
            , diff_result<T>*

           David Abrahams * Boost Consulting
dave_at_[hidden] *

Boost list run by bdawes at, gregod at, cpdaniel at, john at