From 4fe73d6f0262cca8c1c2238511dfc263d9ea2272 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 7 Mar 2002 12:06:44 +0000 Subject: [PATCH] Added add_cv definition [SVN r13121] --- include/boost/type_traits/cv_traits.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/boost/type_traits/cv_traits.hpp b/include/boost/type_traits/cv_traits.hpp index 434ad1e..0df7118 100644 --- a/include/boost/type_traits/cv_traits.hpp +++ b/include/boost/type_traits/cv_traits.hpp @@ -283,11 +283,32 @@ struct add_volatile # pragma warning(pop) #endif }; +// * convert a type T to a const volatile type - add_cv +// this is not required since the result is always +// the same as "T const volatile", but it does suppress warnings +// from some compilers: +template +struct add_cv +{ +#if defined(BOOST_MSVC) && BOOST_MSVC <= 1200 + // This bogus warning will appear when add_volatile is applied to a + // const volatile reference because we can't detect const volatile + // references with MSVC6. +# pragma warning(push) +# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored +#endif + typedef T const volatile type; +#if defined(BOOST_MSVC) && BOOST_MSVC <= 1200 +# pragma warning(pop) +#endif +}; #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct add_const{ typedef T& type; }; template struct add_volatile{ typedef T& type; }; +template +struct add_cv{ typedef T& type; }; #endif } // namespace boost