2
0
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:
Zach Laine
2020-09-01 22:17:33 -05:00
parent 442a17b5d6
commit 6b449dff0e
3 changed files with 16 additions and 6 deletions

10
doc/concepts.qbk Normal file
View 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]

View File

@@ -149,6 +149,7 @@
[include intro.qbk]
[include tutorial.qbk]
[include examples.qbk]
[include concepts.qbk]
[section Compiler Support]

View File

@@ -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