From dcbbbb85e2072d2d042ef992e44d73bfdfeb0f65 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 31 Dec 2003 17:16:37 +0000 Subject: [PATCH] initial commit [SVN r21434] --- include/boost/mpl/print.hpp | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 include/boost/mpl/print.hpp diff --git a/include/boost/mpl/print.hpp b/include/boost/mpl/print.hpp new file mode 100755 index 0000000..d099e9c --- /dev/null +++ b/include/boost/mpl/print.hpp @@ -0,0 +1,64 @@ +// Copyright David Abrahams 2003. Use, modification and distribution is +// subject to 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) +#ifndef PRINT_DWA20031231_HPP +# define PRINT_DWA20031231_HPP + +#include + +namespace boost { namespace mpl +{ + +namespace aux +{ +#if BOOST_MSVC +# pragma warning(push, 3) +// we only want one warning from MSVC, so turn off the other one +# pragma warning(disable: 4307) +#elif __MWERKS__ +# pragma warn_hidevirtual on + struct print_base { virtual void f() {} }; +#endif + +#if __EDG_VERSION__ + template + struct dependent_unsigned + { + static const unsigned value = 1; + }; +#endif +} + + +template +struct print + : mpl::identity +#if __MWERKS__ + , aux::print_base +#endif +{ +#if BOOST_MSVC + enum { n = sizeof(T) + -1 }; +#elif __MWERKS__ + void f(int); +#else + enum { + n = +# if __EDG_VERSION__ + aux::dependent_unsigned::value +# else + sizeof(T) +# endif + > -1, }; +#endif +}; + +}} // namespace boost::mpl + +#if BOOST_MSVC +# pragma warning(pop) +#elif __MWERKS__ +# pragma warn_hidevirtual reset +#endif + +#endif // PRINT_DWA20031231_HPP