value_init.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2005-2012.
  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. #if defined(_MSC_VER)
  15. # pragma once
  16. #endif
  17. #include "config_begin.hpp"
  18. #include <boost/container/detail/workaround.hpp>
  19. namespace boost {
  20. namespace container {
  21. namespace container_detail {
  22. template<class T>
  23. struct value_init
  24. {
  25. value_init()
  26. : m_t()
  27. {}
  28. operator T &() { return m_t; }
  29. T m_t;
  30. };
  31. } //namespace container_detail {
  32. } //namespace container {
  33. } //namespace boost {
  34. #include <boost/container/detail/config_end.hpp>
  35. #endif //#ifndef BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP