1 
2 #ifndef BOOST_MPL_PRINT_HPP_INCLUDED
3 #define BOOST_MPL_PRINT_HPP_INCLUDED
4 
5 // Copyright David Abrahams 2003
6 // Copyright Aleksey Gurtovoy 2004
7 //
8 // Distributed under the Boost Software License, Version 1.0.
9 // (See accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
11 //
12 // See http://www.boost.org/libs/mpl for documentation.
13 
14 // $Id$
15 // $Date$
16 // $Revision$
17 
18 #include <boost/mpl/aux_/config/msvc.hpp>
19 #include <boost/mpl/identity.hpp>
20 
21 namespace boost { namespace mpl {
22 
23 namespace aux {
24 #if defined(BOOST_MSVC)
25 # pragma warning(push, 3)
26 // we only want one warning from MSVC, so turn off the other one
27 # pragma warning(disable: 4307)
28 #elif defined(__MWERKS__)
29 # pragma warn_hidevirtual on
30    struct print_base { virtual void f() {} };
31 #endif
32 
33 #if defined(__EDG_VERSION__)
34   template <class T>
35   struct dependent_unsigned
36   {
37       static const unsigned value = 1;
38   };
39 #endif
40 } // namespace aux
41 
42 template <class T>
43 struct print
44     : mpl::identity<T>
45 #if defined(__MWERKS__)
46     , aux::print_base
47 #endif
48 {
49 #if defined(__clang__)
50     const int m_x = 1 / (sizeof(T) - sizeof(T));
51 #elif defined(BOOST_MSVC)
52     enum { n = sizeof(T) + -1 };
53 #elif defined(__MWERKS__)
54     void f(int);
55 #else
56     enum {
57         n =
58 # if defined(__EDG_VERSION__)
59            aux::dependent_unsigned<T>::value > -1
60 # else
61            sizeof(T) > -1
62 # endif
63         };
64 #endif
65 };
66 
67 #if defined(BOOST_MSVC)
68 # pragma warning(pop)
69 #elif defined(__MWERKS__)
70 # pragma warn_hidevirtual reset
71 #endif
72 
73 }}
74 
75 #endif // BOOST_MPL_PRINT_HPP_INCLUDED
76