/
usr
/
include
/
boost
/
hana
/
fwd
/
/usr/include/boost/hana/fwd
mkdir
upload
Name
Size
Mode
Actions
concept/
-
0755
rm
core/
-
0755
rm
accessors.hpp
1519
0644
edit
dl
rm
adapt_adt.hpp
1596
0644
edit
dl
rm
adapt_struct.hpp
1586
0644
edit
dl
rm
adjust.hpp
1787
0644
edit
dl
rm
adjust_if.hpp
2275
0644
edit
dl
rm
all.hpp
1185
0644
edit
dl
rm
all_of.hpp
1476
0644
edit
dl
rm
and.hpp
1441
0644
edit
dl
rm
any.hpp
1178
0644
edit
dl
rm
any_of.hpp
1445
0644
edit
dl
rm
ap.hpp
2649
0644
edit
dl
rm
append.hpp
2044
0644
edit
dl
rm
at.hpp
2824
0644
edit
dl
rm
at_key.hpp
2334
0644
edit
dl
rm
back.hpp
1355
0644
edit
dl
rm
basic_tuple.hpp
2292
0644
edit
dl
rm
bool.hpp
384
0644
edit
dl
rm
cartesian_product.hpp
1837
0644
edit
dl
rm
chain.hpp
1964
0644
edit
dl
rm
comparing.hpp
1924
0644
edit
dl
rm
concat.hpp
1838
0644
edit
dl
rm
contains.hpp
2378
0644
edit
dl
rm
core.hpp
619
0644
edit
dl
rm
count.hpp
1683
0644
edit
dl
rm
count_if.hpp
1634
0644
edit
dl
rm
cycle.hpp
2460
0644
edit
dl
rm
define_struct.hpp
1582
0644
edit
dl
rm
difference.hpp
854
0644
edit
dl
rm
div.hpp
1772
0644
edit
dl
rm
drop_back.hpp
2016
0644
edit
dl
rm
drop_front.hpp
2268
0644
edit
dl
rm
drop_front_exactly.hpp
2409
0644
edit
dl
rm
drop_while.hpp
2047
0644
edit
dl
rm
duplicate.hpp
1574
0644
edit
dl
rm
empty.hpp
1306
0644
edit
dl
rm
equal.hpp
2584
0644
edit
dl
rm
erase_key.hpp
876
0644
edit
dl
rm
eval.hpp
2012
0644
edit
dl
rm
eval_if.hpp
6453
0644
edit
dl
rm
extend.hpp
1733
0644
edit
dl
rm
extract.hpp
1547
0644
edit
dl
rm
fill.hpp
1412
0644
edit
dl
rm
filter.hpp
2600
0644
edit
dl
rm
find.hpp
1778
0644
edit
dl
rm
find_if.hpp
1734
0644
edit
dl
rm
first.hpp
1470
0644
edit
dl
rm
flatten.hpp
1727
0644
edit
dl
rm
fold.hpp
1066
0644
edit
dl
rm
fold_left.hpp
3004
0644
edit
dl
rm
fold_right.hpp
3193
0644
edit
dl
rm
for_each.hpp
1513
0644
edit
dl
rm
front.hpp
1401
0644
edit
dl
rm
fuse.hpp
1580
0644
edit
dl
rm
greater.hpp
1464
0644
edit
dl
rm
greater_equal.hpp
1563
0644
edit
dl
rm
group.hpp
3872
0644
edit
dl
rm
hash.hpp
2158
0644
edit
dl
rm
if.hpp
1651
0644
edit
dl
rm
index_if.hpp
1846
0644
edit
dl
rm
insert.hpp
1695
0644
edit
dl
rm
insert_range.hpp
1778
0644
edit
dl
rm
integral_constant.hpp
4791
0644
edit
dl
rm
intersection.hpp
872
0644
edit
dl
rm
intersperse.hpp
1780
0644
edit
dl
rm
is_disjoint.hpp
1445
0644
edit
dl
rm
is_empty.hpp
1453
0644
edit
dl
rm
is_subset.hpp
2800
0644
edit
dl
rm
keys.hpp
1338
0644
edit
dl
rm
lazy.hpp
4593
0644
edit
dl
rm
length.hpp
1415
0644
edit
dl
rm
less.hpp
1394
0644
edit
dl
rm
less_equal.hpp
1493
0644
edit
dl
rm
lexicographical_compare.hpp
3819
0644
edit
dl
rm
lift.hpp
1686
0644
edit
dl
rm
map.hpp
13142
0644
edit
dl
rm
max.hpp
1150
0644
edit
dl
rm
maximum.hpp
4344
0644
edit
dl
rm
members.hpp
1256
0644
edit
dl
rm
min.hpp
1525
0644
edit
dl
rm
minimum.hpp
4334
0644
edit
dl
rm
minus.hpp
2101
0644
edit
dl
rm
mod.hpp
1970
0644
edit
dl
rm
monadic_compose.hpp
2296
0644
edit
dl
rm
monadic_fold_left.hpp
4016
0644
edit
dl
rm
monadic_fold_right.hpp
4174
0644
edit
dl
rm
mult.hpp
1933
0644
edit
dl
rm
negate.hpp
1022
0644
edit
dl
rm
none.hpp
1217
0644
edit
dl
rm
none_of.hpp
1498
0644
edit
dl
rm
not.hpp
1220
0644
edit
dl
rm
not_equal.hpp
2115
0644
edit
dl
rm
one.hpp
1116
0644
edit
dl
rm
optional.hpp
18788
0644
edit
dl
rm
or.hpp
1426
0644
edit
dl
rm
ordering.hpp
1902
0644
edit
dl
rm
pair.hpp
5768
0644
edit
dl
rm
partition.hpp
2731
0644
edit
dl
rm
permutations.hpp
1563
0644
edit
dl
rm
plus.hpp
1944
0644
edit
dl
rm
power.hpp
1560
0644
edit
dl
rm
prefix.hpp
2097
0644
edit
dl
rm
prepend.hpp
2415
0644
edit
dl
rm
product.hpp
2636
0644
edit
dl
rm
range.hpp
5480
0644
edit
dl
rm
remove.hpp
2177
0644
edit
dl
rm
remove_at.hpp
2371
0644
edit
dl
rm
remove_if.hpp
2155
0644
edit
dl
rm
remove_range.hpp
2745
0644
edit
dl
rm
repeat.hpp
1624
0644
edit
dl
rm
replace.hpp
1842
0644
edit
dl
rm
replace_if.hpp
1853
0644
edit
dl
rm
replicate.hpp
2511
0644
edit
dl
rm
reverse.hpp
1187
0644
edit
dl
rm
reverse_fold.hpp
2886
0644
edit
dl
rm
scan_left.hpp
3712
0644
edit
dl
rm
scan_right.hpp
3811
0644
edit
dl
rm
second.hpp
1477
0644
edit
dl
rm
set.hpp
9981
0644
edit
dl
rm
size.hpp
929
0644
edit
dl
rm
slice.hpp
3524
0644
edit
dl
rm
sort.hpp
3770
0644
edit
dl
rm
span.hpp
2858
0644
edit
dl
rm
string.hpp
10794
0644
edit
dl
rm
suffix.hpp
2081
0644
edit
dl
rm
sum.hpp
3253
0644
edit
dl
rm
symmetric_difference.hpp
944
0644
edit
dl
rm
take_back.hpp
2178
0644
edit
dl
rm
take_front.hpp
2231
0644
edit
dl
rm
take_while.hpp
1692
0644
edit
dl
rm
tap.hpp
2183
0644
edit
dl
rm
then.hpp
1420
0644
edit
dl
rm
transform.hpp
1467
0644
edit
dl
rm
tuple.hpp
8554
0644
edit
dl
rm
type.hpp
19848
0644
edit
dl
rm
unfold_left.hpp
2546
0644
edit
dl
rm
unfold_right.hpp
2569
0644
edit
dl
rm
union.hpp
811
0644
edit
dl
rm
unique.hpp
3337
0644
edit
dl
rm
unpack.hpp
3560
0644
edit
dl
rm
value.hpp
3159
0644
edit
dl
rm
while.hpp
2432
0644
edit
dl
rm
zero.hpp
1095
0644
edit
dl
rm
zip.hpp
1918
0644
edit
dl
rm
zip_shortest.hpp
2039
0644
edit
dl
rm
zip_shortest_with.hpp
2163
0644
edit
dl
rm
zip_with.hpp
2042
0644
edit
dl
rm
Edit:
/usr/include/boost/hana/fwd/string.hpp
(10794B)
/*! @file Forward declares `boost::hana::string`. @copyright Louis Dionne 2013-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_FWD_STRING_HPP #define BOOST_HANA_FWD_STRING_HPP #include <boost/hana/config.hpp> #include <boost/hana/fwd/core/make.hpp> #include <boost/hana/fwd/core/to.hpp> BOOST_HANA_NAMESPACE_BEGIN #ifdef BOOST_HANA_DOXYGEN_INVOKED //! @ingroup group-datatypes //! Compile-time string. //! //! Conceptually, a `hana::string` is like a tuple holding //! `integral_constant`s of underlying type `char`. However, the //! interface of `hana::string` is not as rich as that of a tuple, //! because a string can only hold compile-time characters as opposed //! to any kind of object. //! //! Compile-time strings are used for simple purposes like being keys in a //! `hana::map` or tagging the members of a `Struct`. However, you might //! find that `hana::string` does not provide enough functionality to be //! used as a full-blown compile-time string implementation (e.g. regexp //! matching or substring finding). Indeed, providing a comprehensive //! string interface is a lot of job, and it is out of the scope of the //! library for the time being. //! //! //! @note //! The representation of `hana::string` is implementation-defined. //! In particular, one should not take for granted that the template //! parameters are `char`s. The proper way to access the contents of //! a `hana::string` as character constants is to use `hana::unpack`, //! `.c_str()` or `hana::to<char const*>`, as documented below. More //! details [in the tutorial](@ref tutorial-containers-types). //! //! //! Modeled concepts //! ---------------- //! For most purposes, a `hana::string` is functionally equivalent to a //! tuple holding `Constant`s of underlying type `char`. //! //! 1. `Comparable`\n //! Two strings are equal if and only if they have the same number of //! characters and characters at corresponding indices are equal. //! @include example/string/comparable.cpp //! //! 2. `Orderable`\n //! The total order implemented for `Orderable` is the usual //! lexicographical comparison of strings. //! @include example/string/orderable.cpp //! //! 3. `Monoid`\n //! Strings form a monoid under concatenation, with the neutral element //! being the empty string. //! @include example/string/monoid.cpp //! //! 4. `Foldable`\n //! Folding a string is equivalent to folding the sequence of its //! characters. //! @include example/string/foldable.cpp //! //! 5. `Iterable`\n //! Iterating over a string is equivalent to iterating over the sequence //! of its characters. Also note that `operator[]` can be used instead of //! the `at` function. //! @include example/string/iterable.cpp //! //! 6. `Searchable`\n //! Searching through a string is equivalent to searching through the //! sequence of its characters. //! @include example/string/searchable.cpp //! //! 7. `Hashable`\n //! The hash of a compile-time string is a type uniquely representing //! that string. //! @include example/string/hashable.cpp //! //! //! Conversion to `char const*` //! --------------------------- //! A `hana::string` can be converted to a `constexpr` null-delimited //! string of type `char const*` by using the `c_str()` method or //! `hana::to<char const*>`. This makes it easy to turn a compile-time //! string into a runtime string. However, note that this conversion is //! not an embedding, because `char const*` does not model the same //! concepts as `hana::string` does. //! @include example/string/to.cpp //! //! Conversion from any Constant holding a `char const*` //! ---------------------------------------------------- //! A `hana::string` can be created from any `Constant` whose underlying //! value is convertible to a `char const*` by using `hana::to`. The //! contents of the `char const*` are used to build the content of the //! `hana::string`. //! @include example/string/from_c_str.cpp //! //! Rationale for `hana::string` not being a `Constant` itself //! ---------------------------------------------------------- //! The underlying type held by a `hana::string` could be either `char const*` //! or some other constexpr-enabled string-like container. In the first case, //! `hana::string` can not be a `Constant` because the models of several //! concepts would not be respected by the underlying type, causing `value` //! not to be structure-preserving. Providing an underlying value of //! constexpr-enabled string-like container type like `std::string_view` //! would be great, but that's a bit complicated for the time being. template <typename implementation_defined> struct string { // Default-construct a `hana::string`; no-op since `hana::string` is stateless. constexpr string() = default; // Copy-construct a `hana::string`; no-op since `hana::string` is stateless. constexpr string(string const&) = default; //! Equivalent to `hana::equal` template <typename X, typename Y> friend constexpr auto operator==(X&& x, Y&& y); //! Equivalent to `hana::not_equal` template <typename X, typename Y> friend constexpr auto operator!=(X&& x, Y&& y); //! Equivalent to `hana::less` template <typename X, typename Y> friend constexpr auto operator<(X&& x, Y&& y); //! Equivalent to `hana::greater` template <typename X, typename Y> friend constexpr auto operator>(X&& x, Y&& y); //! Equivalent to `hana::less_equal` template <typename X, typename Y> friend constexpr auto operator<=(X&& x, Y&& y); //! Equivalent to `hana::greater_equal` template <typename X, typename Y> friend constexpr auto operator>=(X&& x, Y&& y); //! Performs concatenation; equivalent to `hana::plus` template <typename X, typename Y> friend constexpr auto operator+(X&& x, Y&& y); //! Equivalent to `hana::at` template <typename N> constexpr decltype(auto) operator[](N&& n); //! Returns a null-delimited C-style string. static constexpr char const* c_str(); }; #else template <char ...s> struct string; #endif //! Tag representing a compile-time string. //! @relates hana::string struct string_tag { }; #ifdef BOOST_HANA_DOXYGEN_INVOKED //! Create a compile-time `hana::string` from a parameter pack of `char` //! `integral_constant`s. //! @relates hana::string //! //! Given zero or more `integral_constant`s of underlying type `char`, //! `make<string_tag>` creates a `hana::string` containing those characters. //! This is provided mostly for consistency with the rest of the library, //! as `hana::string_c` is more convenient to use in most cases. //! //! //! Example //! ------- //! @include example/string/make.cpp template <> constexpr auto make<string_tag> = [](auto&& ...chars) { return string<implementation_defined>{}; }; #endif //! Alias to `make<string_tag>`; provided for convenience. //! @relates hana::string constexpr auto make_string = make<string_tag>; //! Equivalent to `to<string_tag>`; provided for convenience. //! @relates hana::string constexpr auto to_string = to<string_tag>; //! Create a compile-time string from a parameter pack of characters. //! @relates hana::string //! //! //! Example //! ------- //! @include example/string/string_c.cpp #ifdef BOOST_HANA_DOXYGEN_INVOKED template <char ...s> constexpr string<implementation_defined> string_c{}; #else template <char ...s> constexpr string<s...> string_c{}; #endif //! Create a compile-time string from a string literal. //! @relates hana::string //! //! This macro is a more convenient alternative to `string_c` for creating //! compile-time strings. However, since this macro uses a lambda //! internally, it can't be used in an unevaluated context, or where //! a constant expression is expected before C++17. //! //! //! Example //! ------- //! @include example/string/macro.cpp #ifdef BOOST_HANA_DOXYGEN_INVOKED auto BOOST_HANA_STRING(s) = see documentation; #define BOOST_HANA_STRING(s) see documentation // Note: // The trick above seems to exploit a bug in Doxygen, which makes the // BOOST_HANA_STRING macro appear in the related objects of hana::string // (as we want it to). #else // defined in <boost/hana/string.hpp> #endif #ifdef BOOST_HANA_CONFIG_ENABLE_STRING_UDL namespace literals { //! Creates a compile-time string from a string literal. //! @relatesalso boost::hana::string //! //! The string literal is parsed at compile-time and the result is //! returned as a `hana::string`. This feature is an extension that //! is disabled by default; see below for details. //! //! @note //! Only narrow string literals are supported right now; support for //! fancier types of string literals like wide or UTF-XX might be //! added in the future if there is a demand for it. See [this issue] //! [Hana.issue80] if you need this. //! //! @warning //! This user-defined literal is an extension which requires a special //! string literal operator that is not part of the standard yet. //! That operator is supported by both Clang and GCC, and several //! proposals were made for it to enter C++17. However, since it is //! not standard, it is disabled by default and defining the //! `BOOST_HANA_CONFIG_ENABLE_STRING_UDL` config macro is required //! to get this operator. Hence, if you want to stay safe, just use //! the `BOOST_HANA_STRING` macro instead. If you want to be fast and //! furious (I do), define `BOOST_HANA_CONFIG_ENABLE_STRING_UDL`. //! //! //! Example //! ------- //! @include example/string/literal.cpp //! //! [Hana.issue80]: https://github.com/boostorg/hana/issues/80 template <typename CharT, CharT ...s> constexpr auto operator"" _s(); } #endif BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_FWD_STRING_HPP
Save
cmd:
run