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
14#ifndef BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_FACTORY_SUPPORT_AJK_12FEB2016_HPP
15#define BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_FACTORY_SUPPORT_AJK_12FEB2016_HPP
16
17// Daniel Wallin discovered that bind/apply.hpp badly interacts with the apply<>
18// member template of a factory as used in the optional<> implementation.
19// He proposed this simple fix which is to move the call to apply<> outside
20// namespace boost.
21namespace boost_optional_detail
22{
23 template <class T, class Factory>
24 inline void construct(Factory const& factory, void* address)
25 {
26 factory.BOOST_NESTED_TEMPLATE apply<T>(address);
27 }
28}
29
30namespace boost
31{
32 class in_place_factory_base ;
33 class typed_in_place_factory_base ;
34}
35
36#endif // header guard
37

source code of include/boost/optional/detail/optional_factory_support.hpp