optional_factory_support.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
  2. // Copyright (C) 2016 Andrzej Krzemienski.
  3. //
  4. // Use, modification, and distribution is subject to the Boost Software
  5. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // See http://www.boost.org/libs/optional for documentation.
  9. //
  10. // You are welcome to contact the author at:
  11. // fernando_cacciola@hotmail.com
  12. // akrzemi1@gmail.com
  13. #ifndef BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_FACTORY_SUPPORT_AJK_12FEB2016_HPP
  14. #define BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_FACTORY_SUPPORT_AJK_12FEB2016_HPP
  15. // Daniel Wallin discovered that bind/apply.hpp badly interacts with the apply<>
  16. // member template of a factory as used in the optional<> implementation.
  17. // He proposed this simple fix which is to move the call to apply<> outside
  18. // namespace boost.
  19. namespace boost_optional_detail
  20. {
  21. template <class T, class Factory>
  22. inline void construct(Factory const& factory, void* address)
  23. {
  24. factory.BOOST_NESTED_TEMPLATE apply<T>(address);
  25. }
  26. }
  27. namespace boost
  28. {
  29. class in_place_factory_base ;
  30. class typed_in_place_factory_base ;
  31. }
  32. #endif // header guard