1
// (C) 2002, Fernando Luis Cacciola Carballal.
3
// This material is provided "as is", with absolutely no warranty expressed
4
// or implied. Any use is at your own risk.
6
// Permission to use or copy this software for any purpose is hereby granted
7
// without fee, provided the above notices are retained on all copies.
8
// Permission to modify the code and to distribute modified code is granted,
9
// provided the above notices are retained, and a notice that the code was
10
// modified is included with the above copyright notice.
12
// 21 Ago 2002 (Created) Fernando Cacciola
14
#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
15
#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
17
#include "boost/detail/select_type.hpp"
18
#include "boost/type_traits/cv_traits.hpp"
22
namespace vinit_detail {
29
const_T_base() : x() {}
35
struct non_const_T_base
39
non_const_T_base() : x() {}
48
detail::if_true< ::boost::is_const<T>::value >
49
::template then< const_T_base<T>, non_const_T_base<T> >::type type ;
52
} // namespace vinit_detail
55
class value_initialized : private vinit_detail::select_base<T>::type
59
value_initialized() {}
61
operator T&() const { return this->x ; }
63
T& data() const { return this->x ; }
68
T const& get ( value_initialized<T> const& x )
73
T& get ( value_initialized<T>& x )