Files
boost_mpl/include/boost/mpl/print.hpp
T

75 lines
1.5 KiB
C++
Raw Normal View History

2003-12-31 17:16:37 +00:00
2004-09-02 15:41:37 +00:00
#ifndef BOOST_MPL_PRINT_HPP_INCLUDED
#define BOOST_MPL_PRINT_HPP_INCLUDED
// Copyright David Abrahams 2003
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Source$
// $Date$
// $Revision$
#include <boost/mpl/aux_/config/msvc.hpp>
2003-12-31 17:16:37 +00:00
#include <boost/mpl/identity.hpp>
2004-09-02 15:41:37 +00:00
namespace boost { namespace mpl {
2003-12-31 17:16:37 +00:00
2004-09-02 15:41:37 +00:00
namespace aux {
#if defined(BOOST_MSVC)
2003-12-31 17:16:37 +00:00
# pragma warning(push, 3)
// we only want one warning from MSVC, so turn off the other one
# pragma warning(disable: 4307)
2004-09-02 15:41:37 +00:00
#elif defined(__MWERKS__)
2003-12-31 17:16:37 +00:00
# pragma warn_hidevirtual on
struct print_base { virtual void f() {} };
#endif
2004-09-02 15:41:37 +00:00
#if defined(__EDG_VERSION__)
2003-12-31 17:16:37 +00:00
template <class T>
struct dependent_unsigned
{
static const unsigned value = 1;
};
#endif
2004-09-02 15:41:37 +00:00
} // namespace aux
2003-12-31 17:16:37 +00:00
template <class T>
struct print
2004-09-02 15:41:37 +00:00
: mpl::identity<T>
#if defined(__MWERKS__)
2003-12-31 17:16:37 +00:00
, aux::print_base
#endif
{
2004-09-02 15:41:37 +00:00
#if defined(BOOST_MSVC)
2003-12-31 17:16:37 +00:00
enum { n = sizeof(T) + -1 };
2004-09-02 15:41:37 +00:00
#elif defined(__MWERKS__)
2003-12-31 17:16:37 +00:00
void f(int);
#else
enum {
n =
2004-09-02 15:41:37 +00:00
# if defined(__EDG_VERSION__)
aux::dependent_unsigned<T>::value > -1
2003-12-31 17:16:37 +00:00
# else
2004-09-02 15:41:37 +00:00
sizeof(T) > -1,
2003-12-31 17:16:37 +00:00
# endif
2004-09-02 15:41:37 +00:00
};
2003-12-31 17:16:37 +00:00
#endif
};
2004-09-02 15:41:37 +00:00
#if defined(BOOST_MSVC)
2003-12-31 17:16:37 +00:00
# pragma warning(pop)
2004-09-02 15:41:37 +00:00
#elif defined(__MWERKS__)
2003-12-31 17:16:37 +00:00
# pragma warn_hidevirtual reset
#endif
2004-09-02 15:41:37 +00:00
}}
#endif // BOOST_MPL_PRINT_HPP_INCLUDED