twin.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2014-2014
  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/intrusive for documentation.
  10. //
  11. /////////////////////////////////////////////////////////////////////////////
  12. #ifndef BOOST_INTRUSIVE_DETAIL_TWIN_HPP
  13. #define BOOST_INTRUSIVE_DETAIL_TWIN_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. //A tiny utility to avoid pulling std::pair / utility for
  21. //very simple algorithms/types
  22. namespace boost {
  23. namespace intrusive {
  24. template <class T>
  25. struct twin
  26. {
  27. typedef T type;
  28. twin()
  29. : first(), second()
  30. {}
  31. twin(const type &f, const type &s)
  32. : first(f), second(s)
  33. {}
  34. T first;
  35. T second;
  36. };
  37. } //namespace intrusive{
  38. } //namespace boost{
  39. #endif //BOOST_INTRUSIVE_DETAIL_TWIN_HPP