1
2// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
3// Hinnant & John Maddock 2000.
4// Use, modification and distribution are subject to the Boost Software License,
5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt).
7//
8// See http://www.boost.org/libs/type_traits for most recent version including documentation.
9
10#ifndef BOOST_TT_ADD_VOLATILE_HPP_INCLUDED
11#define BOOST_TT_ADD_VOLATILE_HPP_INCLUDED
12
13#include <boost/config.hpp>
14
15namespace boost {
16
17// * convert a type T to volatile type - add_volatile<T>
18// this is not required since the result is always
19// the same as "T volatile", but it does suppress warnings
20// from some compilers:
21
22#if defined(BOOST_MSVC)
23// This bogus warning will appear when add_volatile is applied to a
24// const volatile reference because we can't detect const volatile
25// references with MSVC6.
26# pragma warning(push)
27# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored
28#endif
29
30template <class T> struct add_volatile{ typedef T volatile type; };
31
32#if defined(BOOST_MSVC)
33# pragma warning(pop)
34#endif
35
36template <class T> struct add_volatile<T&>{ typedef T& type; };
37
38#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
39
40 template <class T> using add_volatile_t = typename add_volatile<T>::type;
41
42#endif
43
44} // namespace boost
45
46#endif // BOOST_TT_ADD_VOLATILE_HPP_INCLUDED
47