1 // Copyright 2002, Fernando Luis Cacciola Carballal.
3 // Distributed under the Boost Software License, Version 1.0. (See
4 // accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // 21 Ago 2002 (Created) Fernando Cacciola
9 #ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
10 #define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
12 #include "boost/detail/select_type.hpp"
13 #include "boost/type_traits/cv_traits.hpp"
17 namespace vinit_detail {
24 const_T_base() : x() {}
30 struct non_const_T_base
34 non_const_T_base() : x() {}
43 boost::detail::if_true< ::boost::is_const<T>::value >
44 ::template then< const_T_base<T>, non_const_T_base<T> >::type type ;
47 } // namespace vinit_detail
50 class value_initialized : private vinit_detail::select_base<T>::type
54 value_initialized() {}
56 operator T&() const { return this->x ; }
58 T& data() const { return this->x ; }
63 T const& get ( value_initialized<T> const& x )
68 T& get ( value_initialized<T>& x )