377 Commits

Author SHA1 Message Date
Antony Polukhin fdf2c0f646 Update copyright years 2026-01-04 11:27:21 +03:00
Antony Polukhin 1fd7271d2e Update copyright years 2025-01-08 19:52:10 +03:00
Antony Polukhin b33ff4f811 Remove obsolete code (#109) 2024-01-08 20:13:32 +03:00
Antony Polukhin e37df948d7 Update copyright years 2024-01-07 12:56:27 +03:00
Antony Polukhin 7b45064ed8 Drop C++03 support (#107)
Drop boost::move and boost::bind dependencies. Use Boost.PP in less cases
2023-08-25 16:02:34 +03:00
Antony Polukhin a3368f0cf8 add C++03 deprecation warnings 2023-05-14 20:10:13 +03:00
Antony Polukhin e4447e892f Update copyright years 2023-01-19 10:24:10 +03:00
fanquake 8bad74942d refactor: use core/addressof over utility/addressof
The later is deprecated.
2022-12-07 16:23:37 +00:00
Antony Polukhin 73753b3d9e avoid recursive inclusion of multivisitors_cpp14_based.hpp
Fixes #101
2022-09-01 11:21:55 +03:00
Antony Polukhin a104ef5f8a Merge pull request #96 from fanquake/core_checked_delete
refactor: use core/checked_delete over checked_delete
2022-08-31 21:40:54 +03:00
Ed Catmur 70ff3706c5 clang/c++23: disable converting move assignment
Workaround https://github.com/boostorg/variant/issues/97
2022-06-29 12:36:16 +01:00
fanquake 281c1791b1 refactor: use core/checked_delete over checked_delete
The later has been deprecated:
```cpp

// The header file at this path is deprecated;
// use boost/core/checked_delete.hpp instead.

```
2022-04-08 14:48:21 +01:00
Antony Polukhin d2fdf2384b update copyright years 2022-01-30 15:03:18 +03:00
Antony Polukhin d80cb48f02 fix issues found by inspect tool 2021-04-26 21:44:35 +03:00
Antony Polukhin 9221b1513c update copyright years 2021-01-03 20:10:23 +03:00
Lucas Camolezi b948c1a486 Added missing <tuple> include
This makes the header able to be built standalone, making possible C++ clang modules builds.
2020-07-24 11:03:10 -03:00
Antony Polukhin 03035b2f6b Fix wrong usage of boost::move (fixes #53, #82) 2020-07-23 15:28:07 +03:00
Vassil Vassilev 9bd4ae5684 Add missing include
Allow header file to be built standalone, in a clang C++ modules context.
2020-07-19 02:45:36 +03:00
Andrey Semashev 351b812267 Updated header locations to avoid warnings about using deprecated headers.
The warnings are generated by no_exceptions_support.hpp. While at it, this
commit also updates locations of several other headers that were moved and
don't generate warnings (yet).

Deprecated headers will be removed in a future release.
2020-05-11 17:28:26 +03:00
Antony Polukhin 2605aa4bff Apply BOOST_OVERRIDE to boost::bad_get::what() and boost::bad_visit::what() (fixes #78) 2020-05-05 20:22:58 +03:00
Edward Diener 1fa5aa0e0a Merge branch 'develop' of https://github.com/eldiener/variant into cppbuilder 2020-04-08 20:45:11 -04:00
Edward Diener a3f266706b Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-31 22:52:39 -04:00
Bart Siwek 74a9d7691c Fix GCC zero-as-null-pointer-constat warnings 2020-03-28 11:42:56 +01:00
Antony Polukhin bee77d42a8 update copyright year 2020-01-11 19:35:53 +03:00
Nikita Kniazev 93c21189e6 Remove unused includes 2019-12-01 19:06:41 +03:00
Antony Polukhin c401edba70 fix typos 2019-06-28 22:44:06 +03:00
Antony Polukhin f34376e115 Merge pull request #66 from Kojoley/partly-mitigate-bad-clang-inlining-decision
Partly mitigate bad Clang inlining decision
2019-05-09 10:01:59 +03:00
Antony Polukhin b18c22a8ff Revert "Merge pull request #59 from Kojoley/recursive_wrapper-move-constructor-pointer-stealing"
This reverts commit dcbfeb9892, reversing
changes made to 055487c5bb.

Reverts adding a pointer stealing to the recursive_wrapper.
2019-05-01 20:57:40 +03:00
Antony Polukhin 0e122c38fe Merge pull request #67 from HDembinski/fix_warning
fix for unused argument warning
2019-04-23 08:56:28 +03:00
Edward Catmur cbdb354a27 Copy variant cvref when determining result type
Ensures that we can e.g. call apply_visitor on a lvalue variant
2019-04-17 15:05:37 +01:00
Hans Dembinski 66ef97f655 fix_warning 2019-04-14 14:02:19 +02:00
Nikita Kniazev dd9b0c9b84 Partly mitigate bad Clang inlining decision
Because a visitor is wrapped several times during visitation it cases extra
temporaries usage and useless store and loads that can only be optimized if
the `visitation_impl` is inlined into the function that creates the wrapper.
Clang inliner decides not to inline functions even with small-sized switches,
resulting in a poor visitation code. Forceinline mark on those internal functions perceptibly improves the situation, though does not mitigate it
completely.

LLVM ticket https://bugs.llvm.org/show_bug.cgi?id=41491
2019-04-14 04:26:31 +03:00
Antony Polukhin 74ea828cde Merge pull request #65 from boostorg/feature/std-hash
Add std::hash specialization for variant (refs #49)
2019-04-12 10:55:46 +03:00
Antony Polukhin 7cc18f356c Merge pull request #63 from Kojoley/do-not-call-abort
Do not call abort in forced_return
2019-04-12 10:54:17 +03:00
Antony Polukhin dcbfeb9892 Merge pull request #59 from Kojoley/recursive_wrapper-move-constructor-pointer-stealing
recursive_wrapper move constructor pointer stealing
2019-04-12 10:52:35 +03:00
Antony Polukhin 31dcc43faf Add std::hash specialization for variant (refs #49) 2019-04-01 23:45:21 +03:00
Nikita Kniazev 3cc73fe162 Do not call abort in forced_return
Reduces code bloating on Clang and MSVC, saves a branch on GCC.
2019-03-26 04:46:43 +03:00
Gregor Jasny dd728220b0 static_visitor: Make destructor public
otherwise in C++ 17 mode Clang 8 will complain about the
protected destructor:

```
main.cpp:16:33: error: temporary of type 'boost::static_visitor<>' has protected destructor
    boost::apply_visitor(output{}, v);
                                ^
/usr/local/opt/boost/include/boost/variant/static_visitor.hpp:53:5: note: declared protected here
    ~static_visitor() = default;
    ^
```

See also discussion in https://reviews.llvm.org/D53860
2019-03-09 15:25:03 +01:00
Nikita Kniazev 32794c2340 More work done 2019-02-24 00:21:54 +03:00
Nikita Kniazev 754eaf824f Updated the documentation 2019-02-16 18:55:42 +03:00
Nikita Kniazev af07139502 refine precondition check to a function 2019-02-09 16:20:26 +03:00
Nikita Kniazev 3e93fd428c followup to recursive_wrapper pointer stealing
- Added macro to switch to the old behavior
  - Added valueless_recursive method
  - Removed nullptr and exchange

TODO:
  - Docs
2019-02-08 20:19:21 +03:00
Nikita Kniazev 1364d3ff5f recursive_wrapper move constructor pointer stealing
Instead of allocating a new object just steal the pointer from the other
recursive_wrapper. It is much cheaper and allows to mark the move constructor
noexcept (allows variant to move the object without backup copying it).
2019-01-31 21:15:10 +03:00
Antony Polukhin d069511e31 Update copyright 2019-01-17 13:00:51 +03:00
Nikita Kniazev 06b643df31 Cleanup includes 2019-01-06 22:15:45 +03:00
Nikita Kniazev 3c5a67e48f Removed EDG 3.2 workaround
EDG 3.2 is pretty old (the workaround added 16 years ago).
2019-01-06 20:31:18 +03:00
Nikita Kniazev c4370b2da2 Removed NO_VOID_RETURNS workaround
The workaround is obsolete, from Boost.Config it looks like it was used for
very old EDG2.4, VC6, and other compilers in VC6 emulation mode.
2019-01-06 00:42:58 +03:00
Nikita Kniazev 4b37f9b804 Fixed visitor result type deduction at rvalue ref operators 2019-01-05 19:54:20 +03:00
Louis Dionne 1c4d882685 Rewrite the deduction of visitor return type
This avoids using boost::declval inside evaluated contexts, which is invalid
and will actually be diagnosed by compilers [1] when the type used inside
boost::declval has internal linkage (such as an anonymous namespace).

[1]: https://bugs.llvm.org/show_bug.cgi?id=35842
2018-11-15 18:55:58 -05:00
Antony Polukhin 50e7df744a Add missing BOOST_SYMBOL_VISIBLE to the bad_visit exception type 2018-09-18 22:41:48 +03:00