Commit Graph

117 Commits

Author SHA1 Message Date
Peter Dimov
e668c099ce Add operator<< for variant 2021-09-15 02:51:11 +03:00
Peter Dimov
8fd9f830a9 Add proper type deduction to visit_by_index 2021-09-15 01:30:09 +03:00
Peter Dimov
ad06c9b923 Add visit_by_index 2021-09-14 21:06:01 +03:00
Peter Dimov
1af7b165cf BOOST_VARIANT2_CX14_ASSERT must be empty under C++11 2021-09-11 18:22:46 +03:00
Peter Dimov
49bff72be0 Define and use a helper macro BOOST_VARIANT2_CX14_ASSERT in constexpr functions 2021-09-11 18:11:17 +03:00
Peter Dimov
59780ba08e Only assert when C++14 2021-09-11 18:00:29 +03:00
Peter Dimov
dce8174550 Make unsafe_get public 2021-09-11 17:29:21 +03:00
Peter Dimov
9d40bc80f1 Use BOOST_ASSERT instead of assert 2021-09-11 17:23:29 +03:00
Peter Dimov
be6ddf9fdc Add boost/variant2.hpp 2021-09-11 17:19:09 +03:00
Peter Dimov
3bc9a57c9b Merge branch 'feature/issue-26' into develop 2021-03-13 18:23:39 +02:00
Peter Dimov
3ca95a65df Use boost::hash in hash_value, not std::hash (closes #27) 2021-03-13 05:08:03 +02:00
Peter Dimov
a2dab8c7d3 Refactor detail::hash_value_L 2021-03-13 04:10:41 +02:00
Peter Dimov
90cda5339f Disable U&& constructor for derived types 2021-03-12 23:40:14 +02:00
Peter Dimov
fb3ce863ff Add MSVC workaround for monospace constexpr (refs #25) 2021-03-08 03:26:40 +02:00
Peter Dimov
3c9f4e56bf Fix visit codegen regression when NDEBUG is not defined 2021-01-24 17:27:24 +02:00
Peter Dimov
3015e56bcb GCC bug 63707 has been fixed for GCC 11 2021-01-23 20:36:12 +02:00
Peter Dimov
453b00dec8 Use (i+1)*2+j for the internal index in the double-buffered case, to avoid branches 2021-01-13 02:10:12 +02:00
Peter Dimov
5586ebaa64 Add support for visit<R> 2020-06-03 17:00:13 +03:00
Peter Dimov
84ea994325 Add specialization for variant_storage_impl<mp_false, ...> 2020-05-09 19:56:27 +03:00
Peter Dimov
465e5bac3d Add specialization for variant_storage_impl<mp_true, ...> to reduce instantiations 2020-05-09 18:14:12 +03:00
Peter Dimov
772ef0d312 Support derived types in visit 2020-05-06 20:11:03 +03:00
Peter Dimov
4b60dee4b6 Avoid gcc warning 'base class should be explicitly initialized in copy constructor' 2020-02-01 01:18:40 +02:00
Peter Dimov
972280e59f Remove commented-out variant_copy_base 2020-01-23 01:08:32 +02:00
Peter Dimov
ef2ef292b9 The msvc-14.0 workarounds are no longer needed 2020-01-22 20:14:11 +02:00
Peter Dimov
3b2fb1a48a Split variant_copy_base into separate cc/ca/mc/ma bases; avoids multiple inheritance, which is a penalty in the MS ABI 2020-01-22 19:59:59 +02:00
Peter Dimov
4f81882bfd Explicitly disable move constructor when needed 2020-01-22 18:30:36 +02:00
Peter Dimov
17bc06b090 Apply msvc-14.0 workarounds 2020-01-22 17:38:45 +02:00
Peter Dimov
c4cad3e96a Use an intermediate trivial base for trivial variants 2020-01-22 17:09:15 +02:00
Peter Dimov
a795f9cf01 Add missing inline 2020-01-11 06:41:21 +02:00
Peter Dimov
1f05cdfb17 Include <functional>, for g++ trunk (10.0) 2020-01-11 06:06:54 +02:00
Peter Dimov
b3229d48b7 gcc < 7 doesn't like specializing std::hash in a different namespace 2020-01-11 05:27:57 +02:00
Peter Dimov
fece11142c Add hashing support 2020-01-11 04:51:30 +02:00
Peter Dimov
f5d9662946 Support -fno-exceptions 2019-06-03 02:46:59 +03:00
Peter Dimov
adeb970be6 Introduce detail::throw_bad_variant_access 2019-06-03 01:05:15 +03:00
Peter Dimov
2d990f774a Remove _real_index 2019-05-12 19:34:21 +03:00
Peter Dimov
3041fff85c Remove expected 2019-05-12 18:56:54 +03:00
Peter Dimov
7f7c74522b Strong guarantee on assignment 2019-05-12 01:46:55 +03:00
Peter Dimov
c3f9beaadc Strong guarantee on emplace 2019-05-12 00:38:21 +03:00
Peter Dimov
70fbd17be9 Change A... to A&&... in is_constructible invocations 2019-04-09 21:14:13 +03:00
Peter Dimov
e8e56139a8 Update msvc workarounds for msvc-14.2 2019-04-09 20:17:28 +03:00
Peter Dimov
2d6385031e Fix emplace for types with a deleted move constructor (in the not trivially destructible case) 2019-04-09 19:22:04 +03:00
Peter Dimov
9f7e525984 Fix emplace for types with a deleted move constructor (in the trivially destructible case) 2019-04-09 18:28:18 +03:00
Peter Dimov
3808c9b122 Fix variant_npos warning 2019-03-25 17:40:39 +02:00
Peter Dimov
9875cfdc98 Add variant_npos and valueless_by_exception() 2019-03-25 16:17:06 +02:00
Peter Dimov
688849f9e8 Remove outcome.hpp and result.hpp 2019-03-25 16:16:10 +02:00
Peter Dimov
204bcce9df Make relational operators constexpr; add test/variant_eq_ne_cx.cpp 2019-03-06 00:26:55 +02:00
Peter Dimov
e5e09c1c04 Only use mp_invoke_q on mp11 1.70 and above 2019-03-05 01:14:09 +02:00
Peter Dimov
fdfe9df167 Do not trivially copy/move assign when not trivially copy/move constructible 2019-03-03 05:14:51 +02:00
Peter Dimov
30d974d0fc Fix exception safety issue in copy/move/converting constructor 2019-02-26 15:12:37 +02:00
Peter Dimov
f4d852e5ab Define detail::unsafe_get, use it in visit 2019-02-22 03:21:56 +02:00