255 Commits

Author SHA1 Message Date
Andrzej Krzemienski
7e0b8145b5 boost::none is constexpr-declared 2020-10-24 17:17:10 +02:00
Andrzej Krzemienski
2b08711ec6 Merge branch 'make_none_t_literal_type' of https://github.com/citrusmoose/optional into citrusmoose-make_none_t_literal_type 2020-10-24 17:05:51 +02:00
Edward Diener
d5b7791710 Merge branch 'develop' of https://github.com/eldiener/optional into cppbuilder 2020-04-17 05:55:24 -04:00
Andrzej Krzemienski
9b1f8033eb Merge branch 'develop' of https://github.com/RobertLeahy/optional-2 into RobertLeahy-develop 2020-04-06 00:42:05 +02:00
Andrzej Krzemienski
ed9edd54e4 Merge branch 'suppress-weak-vtables-warning' of https://github.com/Kojoley/optional into Kojoley-suppress-weak-vtables-warning 2020-04-05 23:30:40 +02:00
Edward Diener
78d6563bce Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-30 14:04:35 -04:00
Robert Leahy
9581804efa GCC 4.4.7: boost::in_place & Assignment
Assigning a boost::in_place_factory to a boost::optional templated on a
type which was trivially copyable failed to compile under GCC 4.4.7.
2019-12-23 11:24:39 -05:00
Andrzej Krzemienski
0481b05d1f Merge branch 'cxx20_fix' of https://github.com/CaseyCarter/optional into CaseyCarter-cxx20_fix 2019-12-19 20:56:34 +01:00
Andrey Semashev
9ed20cb085 Marked none instances as inline variables.
This should avoid duplicating none instances in all translation units.

Closes https://github.com/boostorg/optional/issues/33.
2019-12-19 20:22:16 +01:00
Casey Carter
4fbb7582e1 Don't instantiate is_convertible_to_T_or_factory when is_optional_related
Fixes #78.
2019-12-18 17:51:51 -08:00
Nikita Kniazev
ee575b34c5 Fix unused argument warning
boost/optional/optional.hpp:970:5: warning: unused parameter 'rhs' [-Wunused-parameter]
2019-02-28 00:13:00 +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
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
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
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
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
0169460194 fixed tests and maybe std::is_trivially_default_constructible 2018-06-25 22:50:00 +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
76ff82d191 Silenced warning -Wzero-as-null-pointer-constant 2018-02-15 22:51:08 +01:00
Peter Klotz
a5aaf4d8d0 Fixed recurring typo 2018-02-11 21:03:54 +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
Andrzej Krzemienski
fb54ee1741 Fixed spelling mistake in macros 2017-11-07 23:35:01 +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
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 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
Andrzej Krzemienski
2d2c3c3f6f trivially-copyable optional<T> for trivial T 2017-11-07 23:34:05 +01:00
Andrey Semashev
e95f9fc254 Convert tabs to spaces. 2017-11-07 23:34:02 +01:00
Andrey Semashev
7e1beb473c Use BOOST_MAY_ALIAS from Boost.Config. 2017-11-07 23:33:59 +01:00
Andrzej Krzemienski
4fe57f57fa Fix make_optional for rvalues 2017-11-07 23:33:54 +01:00
Daniel J. Hofmann
c695be11b5 Adds forwarding make_optional helpers, resolves #30 2017-11-07 23:32:27 +01:00
Matt
b709447922 r #12967 use BOOST_CONSTEXPR on none_t ctor 2017-08-16 13:52:46 -04:00
Matt
cd4e44f3dc r #12967 make none_t constructor constexpr 2017-04-13 09:13:26 -04:00
Andrzej Krzemienski
17826eae3b more old compiler workarounds 2016-11-24 23:20:25 +01:00
Andrzej Krzemienski
d73b5110dd corrected the compiler workarounds 2016-11-22 02:35:24 +01:00
Andrzej Krzemienski
b4907c2a51 old compiler workarounds for the previous two fixes 2016-11-20 23:42:41 +01:00
Andrzej Krzemienski
fafb3abb64 Implemented reset syntax: o = {} 2016-11-19 21:14:28 +01:00
Andrzej Krzemienski
7ea2ca6c40 Fix #12563 2016-11-19 14:57:40 +01:00
Andrzej Krzemienski
8d69e99e78 removed hack test, updated copyright 2016-11-06 01:49:53 +01:00
Andrzej Krzemienski
9bc1cc585c small sfinae fix for in_place constructors 2016-11-02 22:28:20 +01:00
Andrzej Krzemieński
4e08f0dd41 Fixed build in C++03 compiler 2016-10-28 11:49:33 +02:00