mirror of
https://github.com/boostorg/fusion.git
synced 2025-06-29 22:01:01 +02:00
[Deque] Make the from-sequence constructor SFINAE friendly
This commit is contained in:
@ -149,7 +149,8 @@ namespace boost { namespace fusion
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit deque(Sequence const& seq
|
||||
, typename disable_if<is_convertible<Sequence, Head> >::type* /*dummy*/ = 0)
|
||||
, typename disable_if<is_convertible<Sequence, Head> >::type* /*dummy*/ = 0
|
||||
, typename enable_if<traits::is_sequence<Sequence> >::type* /*dummy*/ = 0)
|
||||
: base(base::from_iterator(fusion::begin(seq)))
|
||||
{}
|
||||
|
||||
|
@ -86,6 +86,7 @@ project
|
||||
[ run sequence/deque_copy.cpp : : : : ]
|
||||
[ run sequence/deque_iterator.cpp : : : : ]
|
||||
[ run sequence/deque_hash.cpp : : : : ]
|
||||
[ run sequence/deque_is_constructible.cpp : : : : ]
|
||||
[ run sequence/deque_make.cpp : : : : ]
|
||||
[ run sequence/deque_misc.cpp : : : : ]
|
||||
[ run sequence/deque_move.cpp : : : : ]
|
||||
|
17
test/sequence/deque_is_constructible.cpp
Normal file
17
test/sequence/deque_is_constructible.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2015 Louis Dionne
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#include <type_traits>
|
||||
#include <boost/fusion/include/deque.hpp>
|
||||
|
||||
|
||||
struct Dummy { };
|
||||
|
||||
// Make sure deque's constructor is SFINAE-friendly.
|
||||
static_assert(!std::is_constructible<boost::fusion::deque<int>, Dummy const&>::value, "");
|
||||
|
||||
int main() { }
|
Reference in New Issue
Block a user