value_init.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2005-2013.
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/container for documentation.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. #ifndef BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP
  13. #define BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP
  14. #ifndef BOOST_CONFIG_HPP
  15. # include <boost/config.hpp>
  16. #endif
  17. #if defined(BOOST_HAS_PRAGMA_ONCE)
  18. # pragma once
  19. #endif
  20. #include <boost/container/detail/config_begin.hpp>
  21. #include <boost/container/detail/workaround.hpp>
  22. namespace boost {
  23. namespace container {
  24. namespace dtl {
  25. template<class T>
  26. struct value_init
  27. {
  28. value_init()
  29. : m_t()
  30. {}
  31. operator T &() { return m_t; }
  32. T &get() { return m_t; }
  33. T m_t;
  34. };
  35. } //namespace dtl {
  36. } //namespace container {
  37. } //namespace boost {
  38. #include <boost/container/detail/config_end.hpp>
  39. #endif //#ifndef BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP