mirror of
https://github.com/boostorg/parser.git
synced 2026-01-19 04:22:13 +00:00
Add concepts section to docs.
This commit is contained in:
10
doc/concepts.qbk
Normal file
10
doc/concepts.qbk
Normal file
@@ -0,0 +1,10 @@
|
||||
[/
|
||||
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
/]
|
||||
|
||||
[section Concepts]
|
||||
|
||||
[all_concepts]
|
||||
|
||||
[endsect]
|
||||
@@ -149,6 +149,7 @@
|
||||
[include intro.qbk]
|
||||
[include tutorial.qbk]
|
||||
[include examples.qbk]
|
||||
[include concepts.qbk]
|
||||
|
||||
[section Compiler Support]
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
namespace boost { namespace parser {
|
||||
|
||||
//[ all_concepts
|
||||
template<typename T>
|
||||
concept utf8_code_unit = std::integral<T> && sizeof(T) == 1;
|
||||
|
||||
@@ -96,8 +97,6 @@ namespace boost { namespace parser {
|
||||
std::declval<detail::nope &>(),
|
||||
std::declval<detail::symbol_table_tries_t &>()));
|
||||
|
||||
// clang-format off
|
||||
|
||||
template<typename T, typename I, typename S, typename GlobalState>
|
||||
concept error_handler =
|
||||
requires (
|
||||
@@ -114,7 +113,7 @@ namespace boost { namespace parser {
|
||||
t.diagnose(kind, message, context);
|
||||
};
|
||||
|
||||
//[ container_concept
|
||||
//[ container_concept
|
||||
template<typename T>
|
||||
concept container = std::ranges::common_range<T> && requires(T t) {
|
||||
{ t.insert(t.begin(), *t.begin()) }
|
||||
@@ -122,7 +121,9 @@ namespace boost { namespace parser {
|
||||
{ t.insert(t.begin(), t.begin(), t.end()) }
|
||||
-> std::same_as<std::ranges::iterator_t<T>>;
|
||||
};
|
||||
//]
|
||||
//]
|
||||
|
||||
//]
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -132,8 +133,6 @@ namespace boost { namespace parser {
|
||||
|
||||
}
|
||||
|
||||
// clang-format on
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user