Commit Graph

486 Commits

Author SHA1 Message Date
Andrey Semashev 2f3cf1ca84 Added a test to verify that boost::optional copy constructor does not invoke T's template constructors. 2018-11-04 17:54:57 +03:00
Andrey Semashev 24d29e5865 Fix for clang, when adapted type is convertible from other types.
The problem was with copy/move constructors of boost::optional<T>, which invoked
optional_base<T> constructors with a single argument. Since optional_base has
copy/move constructors along with initializing constructors taking a single
argument, the latter may be considered by the compiler for viability. While
doing so, the compiler may instantiate the template constructor of T with
an argument of optional_base<T>, which in turn may fail if the constructor
attempts to inspect the type of its argument (e.g. to constrain the set of
acceptable types). Specifically, this happens with clang in C++03 mode,
when boost::multiprecision::number is wrapped in boost::optional and
a copy constructor of boost::optional is invoked.

This commit fixes the problem by destinguishing copy/move constructors of
optional_base from initializing constructors with an additional tag argument.
2018-11-04 17:35:10 +03:00
Andrzej Krzemienski 69e239530e docs: updated releasenotes 2018-10-29 22:06:47 +01:00
Andrzej Krzemienski 65bb040db8 tests: added two test cases from GitHub issues 2018-10-29 21:47:09 +01:00
Andrzej Krzemienski fae2791f45 added test for swapping const opitonals 2018-10-25 00:37:13 +02:00
Andrzej Krzemienski 0f8e356bca rebuilt docs 2018-10-23 22:46:26 +02:00
Andrzej Krzemienski 59277bc31f Merge branch 'Kojoley-remove-deprecation-mark-from-reset' into develop 2018-10-23 22:35:55 +02:00
Nikita Kniazev bebc606a4c Remove deprecation mark from reset()
The `std::optional` has `reset()` [optional.mod] and it is not deprecated.
2018-10-23 22:34:10 +02:00
Andrzej Krzemieński 106f9aee5e Merge pull request #60 from Kojoley/workaround-gcc-8-9-regression
Workaround GCC 8-9 regression
2018-10-15 16:36:17 +02:00
Nikita Kniazev 350ebab88a Workaround GCC 8-9 regression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531
2018-10-05 18:47:16 +03:00
Andrzej Krzemieński a3916b46a9 Merge pull request #58 from boostorg/pr/remove-mpl
Remove dependency on MPL
2018-09-12 22:39:53 +02:00
Peter Dimov c52280bb78 Remove dependency on MPL 2018-09-12 20:02:47 +03:00
Andrzej Krzemienski 228b20df82 fixed old implementation (issue #57) 2018-07-12 00:30:47 +02:00
Andrzej Krzemienski d0b87d2f35 documented flat_map 2018-07-02 23:23:46 +02:00
Andrzej Krzemienski 71d797b9ee added implementation and tests of flat_map() 2018-06-28 23:30:47 +02:00
Andrzej Krzemienski 701afd43a4 fixed strange verisons of libstdc++ 2018-06-28 21:17:07 +02:00
Andrzej Krzemienski d13623884a hopefully fixed the libstdc++ 4.9 problem (thanks Jonathan) 2018-06-28 02:10:57 +02:00
Andrzej Krzemienski 7320dd54e8 one more test hack macro to check 2018-06-27 22:23:57 +02:00
Andrzej Krzemienski 51a46f95c6 testing clang v. 2018-06-26 00:04:33 +02:00
Andrzej Krzemienski 35ca7c1ff1 added a hack test to check compiler setup 2018-06-25 23:59:19 +02:00
Andrzej Krzemienski 0169460194 fixed tests and maybe std::is_trivially_default_constructible 2018-06-25 22:50:00 +02:00
Andrzej Krzemienski 42445e94aa Fix for C++03 tests for .map() using result_of 2018-06-24 17:12:38 +02:00
Andrzej Krzemienski 250806d029 fixed >> int C++03 templates 2018-06-24 15:22:56 +02:00
Andrzej Krzemienski 51d1bc843d test and doc update for .map() 2018-06-23 20:53:16 +02:00
Andrzej Krzemienski e47a017009 added o.map() 2018-06-23 18:27:14 +02:00
Andrzej Krzemienski 5182f7f30f Added has_value() 2018-03-24 00:04:15 +01:00
akrzemi1 33c7a6aa2b docs: relnotes for 1.67 2018-03-01 01:10:42 +01:00
akrzemi1 76ff82d191 Silenced warning -Wzero-as-null-pointer-constant 2018-02-15 22:51:08 +01:00
Andrzej Krzemieński b1e29eb585 Merge pull request #50 from pkl97/develop
Fixed recurring typo
2018-02-12 08:44:23 +01:00
Peter Klotz a5aaf4d8d0 Fixed recurring typo 2018-02-11 21:03:54 +01:00
Andrzej Krzemieński 1f6d8bc602 Merge pull request #47 from petamas/bugfix/member_T
Fix #46: optional<X> fails to compile with VS2015 if X has an embedded enum named T
2018-01-03 14:08:31 +01:00
petamas e230bd83c6 Fix compilation of template parameter with member enum T on VS2015
Issue: https://github.com/boostorg/optional/issues/46
2018-01-03 10:46:31 +01:00
petamas b832d4c54f Add test for template parameter with member enum T (fails by default on VS2015)
Issue: https://github.com/boostorg/optional/issues/46ű
2018-01-03 10:37:37 +01:00
Andrzej Krzemienski fb54ee1741 Fixed spelling mistake in macros boost-1.66.0 2017-11-07 23:35:01 +01:00
Andrzej Krzemienski 5b6f4be434 Fix make_optional for rvalues 2017-11-07 23:34:56 +01:00
Andrzej Krzemienski f9fdf42a17 fix for the previous partial commit 2017-11-07 23:34:52 +01:00
Andrzej Krzemienski 7541076cf1 fixed defaulted moves on older compilers 2017-11-07 23:34:41 +01:00
Andrzej Krzemienski 40f7c97292 Fixed -Wmaybe-uninitialized 2017-11-07 23:34:37 +01:00
Andrzej Krzemienski 06dea2cb9b Reverted specialization for trivial types
It caused too many problems. I left only specialiation for scalar types.
I will need to devise clever type traits for reconizing trivial types with working constructor.
2017-11-07 23:34:34 +01:00
Vinnie Falco cbf3cd05af Test case for #43 2017-11-07 23:34:31 +01:00
Andrzej Krzemieński 6e10173a44 Fixed silly && bug 2017-11-07 23:34:28 +01:00
Andrzej Krzemienski 69bf75ae6d Fix trivially-constructible bug with deleted functions 2017-11-07 23:34:26 +01:00
Andrzej Krzemieński 01ebd2ad7f Added tests for types with deleted default ctor 2017-11-07 23:34:23 +01:00
Vinnie Falco 42c2377a0d Add tc_optional_base test 2017-11-07 23:34:20 +01:00
Andrzej Krzemienski 9d0ddc4709 fixed regression on compilers w/o type trait support 2017-11-07 23:34:18 +01:00
Andrzej Krzemienski a7f33f5d6f more defensive checking for trivial types -- avoiding bugs 2017-11-07 23:34:15 +01:00
Andrzej Krzemienski 58f7c2f14a fix bug with defaulted move in msvc 12.0 2017-11-07 23:34:12 +01:00
Peter Dimov ebef3ed6f7 Try to make the test closer to the failing case in Beast 2017-11-07 23:34:09 +01:00
Peter Dimov 9e0726cee1 Add test for a deleted default constructor 2017-11-07 23:34:07 +01:00
Andrzej Krzemienski 2d2c3c3f6f trivially-copyable optional<T> for trivial T 2017-11-07 23:34:05 +01:00