421 Commits

Author SHA1 Message Date
Peter Dimov
12c95c48cf minstd_rand has been moved to Core 2024-04-14 06:10:37 +03:00
Andrey Semashev
cea4262e62 Trim trailing spaces. 2023-09-03 02:10:47 +03:00
Andrey Semashev
52e3e64a34 Switch to boost::core::invoke_swap.
boost::swap is deprecated and will be removed. Use boost::core::invoke_swap
as a replacement.
2023-09-03 02:10:18 +03:00
Andrey Semashev
581654e408 Use assert in string_view::remove_prefix/suffix to enforce preconditions.
This is in line with std::string_view::remove_prefix/suffix definition, where
calling the method with n > size() is UB. We're keeping the check to clamp
n to size() for now for backward compatibility so that it can be eventually
removed.

Closes https://github.com/boostorg/utility/issues/92.
2022-07-05 23:53:47 +03:00
Andrey Semashev
c63d36cf5b Added string_view::contains methods.
These methods were added in C++23.

Also updated string_view/ref tests:

- Added tests for string_view::contains.
- Added missing includes.
- Added missing std:: qualification.
- Removed tabs.
- Fixed misleading indentation (fixes gcc warnings).
- Fixed decrementing pointer before beginning of the string.

Closes https://github.com/boostorg/utility/issues/93.
2022-05-04 00:32:30 +03:00
Andrey Semashev
0106ffda5f Added string_view/ref::substr overloads taking no arguments.
This effectively adds support for pos=0 default argument value.
The separate overload is better as it avoids instantiating std::min,
boost::throw_exception and removes std::out_of_range construction, which
potentially reduces code size, while maintaining the same behavior.

Fixes https://github.com/boostorg/utility/issues/96.
2022-05-03 00:46:03 +03:00
Andrey Semashev
0c1d01d30a Removed noexcept from string_view::compare that may throw.
One overload of string_view::compare calls substr internally,
which may throw. This makes compare potentially throwing.

Fixes https://github.com/boostorg/utility/issues/94.
2022-05-03 00:42:20 +03:00
Andrey Semashev
7ac95c156c Fixed string_view/ref::max_size() returning incorrect value.
Fixes https://github.com/boostorg/utility/issues/91.
2022-05-03 00:38:15 +03:00
Andrey Semashev
eb29d71245 Corrected argument type in string_view/ref::at(). 2022-05-03 00:23:10 +03:00
fanquake
f11a56c2a7
refactor: use core/swap over deprecated swap header
In boost/swap.hpp:
```cpp
// The header file at this path is deprecated;
// use boost/core/swap.hpp instead.

```
2022-04-29 16:08:20 +01:00
Andrey Semashev
69f6588d7c Updated comment. 2022-01-17 17:53:42 +03:00
Andrey Semashev
6950023bca Added a link to the ticket with discussion re. MSVC warning 4913. 2022-01-17 17:49:37 +03:00
Andrey Semashev
c3aab6a184 Use #ifdef to test for BOOST_MSVC. 2022-01-17 17:42:45 +03:00
Nikita Kniazev
63aadf3f0f
result_of_callable_class: suppress MSVC C4512
`result_of_callable_class` derives from a user provided type which might not be eligible for an implicit assignment operator causing an annoying warning
2022-01-16 22:34:34 +03:00
Nikita Kniazev
de106bf696
Fix extra tokens after #endif
Regression from #79
2021-11-22 17:17:57 +03:00
Alan de Freitas
a3ec92334d Remove implementation detail from compressed pair private inheritance 2021-11-15 15:49:54 -03:00
Alan de Freitas
1d6d44c1c4 Generate doxygen xml reference 2021-11-11 17:46:09 -03:00
Nikita Kniazev
6cca23a63a Cease dependence on ContainerHash
by local `hash_range` forward declaration
2021-06-20 19:34:05 +03:00
Andrey Semashev
601f80e8c1
Merge pull request #75 from Kojoley/feature/result_of-variadic-templates
Use variadic templates in result_of
2021-04-22 23:12:34 +03:00
vahtis
6ab27d5689
Workaround for Oracle Developer Studio
Oracle Developer Studio needs same workaround as VIsual Studio
2021-03-25 11:32:37 +02:00
Nikita Kniazev
3e2f0199cf Use variadic templates in result_of 2021-03-08 04:25:46 +03:00
Marshall Clow
9c2aa8d193 Revert "Make string_{view|ref} remove_prefix and remove_suffix throw on invalid lengths. Addresses issue #73"
This reverts commit 601fc9371ff157b05bc16622871e92fb0f94d272.
2021-03-01 16:50:14 -08:00
Marshall Clow
601fc9371f Make string_{view|ref} remove_prefix and remove_suffix throw on invalid lengths. Addresses issue #73 2021-03-01 06:52:49 -08:00
Peter Dimov
8faf831bd1 memset data_ instead of *this 2020-05-25 23:50:35 +03:00
Peter Dimov
25cb7aa122 Use a base class to apply the memset workaround to avoid dependency on TypeTraits 2020-05-25 05:09:36 +03:00
Glen Fernandes
64fffa0f97 Simplify BOOST_OPERATORS_CONSTEXPR definition 2020-04-12 13:03:30 -04:00
Glen Fernandes
5da340a2a4 Rename BOOST_OPS_CONSTEXPR to BOOST_OPERATORS_CONSTEXPR 2020-04-12 13:03:22 -04:00
Marshall Clow
0c059a50ad
Merge pull request #63 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74. Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost conf…
2020-04-12 09:49:06 -07:00
Daniel Frey
bdc5b5cf3a
Merge pull request #55 from tonyelewis/add-constexpr-support
Add constexpr to operators (w/ basic docs, tests)
2020-04-12 13:07:24 +02:00
Tony Lewis
46f72656b3 Remove constexpr from all but the comparison ops 2020-04-11 18:31:15 +01:00
Tony Lewis
e3a2a06011 Re-add constexpr support for newer MSVC versions 2020-04-11 18:30:24 +01:00
Edward Diener
a4752e066d Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-24 01:39:51 -04:00
Glen Fernandes
2b436d7d50 Use ostream_put from Boost.IO 2019-12-15 09:46:38 -05:00
Andrey Semashev
9eeb7f85c5 Replaced tabs with spaces. 2019-06-25 15:46:36 +03:00
Glen Fernandes
dabf53a703 Refactor stream write functionality into a standalone utility 2019-04-19 09:53:29 -04:00
Glen Fernandes
5fe9df91c0 Make string_view operator<< use rdbuf directly 2019-04-12 18:06:35 -04:00
Tony Lewis
6b62dcc504 Completely remove constexpr for MSVC 2018-12-24 07:02:31 +00:00
Tony Lewis
91ebdcd1dd Remove C++14 constexpr due to MSVC/GCC problems 2018-12-22 15:52:13 +00:00
Tony Lewis
e8d2b2ba76 Add constexpr to operators (w/ basic docs, tests) 2018-12-21 10:28:22 +00:00
Marshall Clow
db05c11f50 Fix string_ref::find/rfind's handling of empty strings. Thanks to 'reluctantbugreporter' for the bug report 2018-09-14 09:48:13 -07:00
Glen Fernandes
fc135e0d72 Avoid inheritance for final types in compressed_pair 2018-09-09 17:34:22 -04:00
Peter Dimov
bdf55e0b6f Add boilerplate reference to LICENSE_1_0.txt 2018-07-31 00:22:42 +03:00
Dimitrij Mijoski
e2d115db97 Use hash_fwd.hpp in string_view for more lightweight dependencies. 2018-04-20 23:18:31 +02:00
Dimitrij Mijoski
6ad6bc005c Implement boost hash for string_view 2018-04-20 13:42:07 +02:00
Dimitrij Mijoski
eacea4664d implement string_view.find(string) in terms of traits.compare and find.
This should be faster that it's previous implementations
in terms of std::search()
2018-04-02 00:52:57 +02:00
Dimitrij Mijoski
1fe5af5264 Faster find functions in string_view by using traits::find() 2018-04-01 20:00:03 +02:00
Peter Dimov
c88936800d Remove dependency on Random in operators_test.cpp 2017-12-23 06:19:43 +02:00
Peter Dimov
9d46de1578 Replace use of mpl/has_xxx.hpp with handwritten traits 2017-12-21 06:30:03 +02:00
Peter Dimov
7d101d420c Replace mpl primitives with type_traits 2017-12-20 21:55:07 +02:00
Peter Dimov
d8acfef27b Update includes in utility.hpp; add deprecation comment 2017-12-02 04:35:22 +02:00