File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,19 @@ namespace elle
131131
132132 template <typename T, typename A>
133133 std::enable_if_t <
134- !std::is_same<std::remove_cv_reference_t <T>, Head>::value,
134+ std::is_same<std::remove_cv_reference_t <T>, std::nullptr_t >::value &&
135+ std::is_same<Head, void >::value,
136+ void >
137+ _emplace (A&& value)
138+ {
139+ this ->_index = Index;
140+ }
141+
142+ template <typename T, typename A>
143+ std::enable_if_t <
144+ !std::is_same<std::remove_cv_reference_t <T>, Head>::value &&
145+ (!std::is_same<std::remove_cv_reference_t <T>, std::nullptr_t >::value ||
146+ !std::is_same<Head, void >::value),
135147 void >
136148 _emplace (A&& value)
137149 {
Original file line number Diff line number Diff line change @@ -390,10 +390,17 @@ static
390390void
391391void_member ()
392392{
393- elle::Option<void , int > x (42 );
394- BOOST_TEST (x.is <int >());
395- BOOST_TEST (!x.is <void >());
396- BOOST_TEST (x.get <int >() == 42 );
393+ {
394+ elle::Option<void , int > x (42 );
395+ BOOST_TEST (x.is <int >());
396+ BOOST_TEST (!x.is <void >());
397+ BOOST_TEST (x.get <int >() == 42 );
398+ }
399+ {
400+ elle::Option<void , int > x (nullptr );
401+ BOOST_TEST (!x.is <int >());
402+ BOOST_TEST (x.is <void >());
403+ }
397404}
398405
399406ELLE_TEST_SUITE ()
You can’t perform that action at this time.
0 commit comments