[Boost-bugs] [Boost C++ Libraries] #11682: fusion::pair not compatible with std::is_default_constructible

Subject: [Boost-bugs] [Boost C++ Libraries] #11682: fusion::pair not compatible with std::is_default_constructible
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-09-24 14:59:03


#11682: fusion::pair not compatible with std::is_default_constructible
------------------------------+---------------------
 Reporter: crmoore@… | Owner: djowel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: fusion
  Version: Boost 1.59.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------
 When the {{{Second}}} type of pair is not default constructible,
 {{{std::is_default_constructible}}} either returns true or fails to
 compile for fusion::pair.

 This is on OSX with apple and macports compilers.

 Adding {{{enable_if< is_default_constructible<Second> >}}} to pair's
 default constructor makes this work as expected.

 {{{
 struct NotDefaultConstructible {
   NotDefaultConstructible(int){};
 };

 // prints 0
 std::cout << std::is_default_constructible< NotDefaultConstructible
>::value << std::endl;

 using fusion_pair1 = boost::fusion::pair<int, NotDefaultConstructible>;

 // should print 0
 // fails to compile on clang (xcode 7, 3.4, 3.6, 3.7), gcc 4.9
 // prints 1 on gcc 5, clang 3.4
 std::cout << std::is_default_constructible< fusion_pair1 >::value <<
 std::endl;
 }}}

 Test and patch attached. Patch is unlikely to meat portability
 requirements to be applied as-is.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11682>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC