Showing preview only (2,942K chars total). Download the full file or copy to clipboard to get everything.
Repository: think-cell/think-cell-library
Branch: main
Commit: 9b334a494d66
Files: 393
Total size: 2.7 MB
Directory structure:
gitextract_lxw4u0yo/
├── .gitattributes
├── .github/
│ └── workflows/
│ └── main.yml
├── CMakeLists.txt
├── LICENSE_1_0.txt
├── README.md
├── range.example.cpp
└── tc/
├── algorithm/
│ ├── accumulate.h
│ ├── algorithm.h
│ ├── algorithm.t.cpp
│ ├── any_accu.h
│ ├── append.h
│ ├── append.t.cpp
│ ├── best_element.h
│ ├── binary_operators.h
│ ├── break_or_continue.h
│ ├── compare.h
│ ├── element.h
│ ├── element.t.cpp
│ ├── empty.h
│ ├── empty.t.cpp
│ ├── equal.h
│ ├── equal.t.cpp
│ ├── filter_inplace.h
│ ├── find.h
│ ├── find_closest_if.h
│ ├── find_closest_if.t.cpp
│ ├── for_each.h
│ ├── for_each.t.cpp
│ ├── for_each_xxx.h
│ ├── interleave_ranges.h
│ ├── longest_common_prefix.h
│ ├── longest_common_prefix.t.cpp
│ ├── minmax.h
│ ├── partition_iterator.h
│ ├── partition_range.h
│ ├── quantifier.h
│ ├── quantifier.t.cpp
│ ├── restrict_size_decrement.h
│ ├── round.h
│ ├── round.t.cpp
│ ├── size.h
│ ├── size_bounded.h
│ ├── size_linear.h
│ ├── sort_streaming.h
│ └── sort_streaming.t.cpp
├── array.h
├── base/
│ ├── accessors.h
│ ├── as_lvalue.h
│ ├── assert_defs.h
│ ├── bit_cast.h
│ ├── bitfield.h
│ ├── bitfield.t.cpp
│ ├── casts.h
│ ├── casts.t.cpp
│ ├── chained.h
│ ├── change.h
│ ├── conditional.h
│ ├── conditional.t.cpp
│ ├── construction_restrictiveness.h
│ ├── derivable.h
│ ├── empty_chain.h
│ ├── enum.h
│ ├── enum.t.cpp
│ ├── explicit_cast.h
│ ├── explicit_cast_fwd.h
│ ├── functors.h
│ ├── fundamental.h
│ ├── generic_macros.h
│ ├── has_xxx.h
│ ├── inplace.h
│ ├── inside_unwinding.h
│ ├── integer.h
│ ├── invoke.h
│ ├── invoke.t.cpp
│ ├── invoke_with_constant.h
│ ├── large_integer.h
│ ├── modified.h
│ ├── modified.t.cpp
│ ├── move.h
│ ├── noncopyable.h
│ ├── ref.h
│ ├── reference_or_value.h
│ ├── reference_or_value.t.cpp
│ ├── renew.h
│ ├── return_decltype.h
│ ├── rvalue_property.h
│ ├── rvalue_property.t.cpp
│ ├── safe_comparison.h
│ ├── safe_comparison.t.cpp
│ ├── scope.h
│ ├── static_polymorphism.h
│ ├── string_template_param.h
│ ├── tag_type.h
│ ├── template_func.h
│ ├── temporary.h
│ ├── temporary.t.cpp
│ ├── track_instance.h
│ ├── track_instance.t.cpp
│ ├── trivial_functors.h
│ ├── trivial_functors.t.cpp
│ ├── type_list.h
│ ├── type_list.t.cpp
│ ├── type_traits.h
│ ├── type_traits.t.cpp
│ ├── type_traits_fwd.h
│ ├── utility.h
│ └── utility.t.cpp
├── compat.t.cpp
├── const.t.cpp
├── container/
│ ├── cont_assign.h
│ ├── cont_assign.t.cpp
│ ├── cont_reserve.h
│ ├── container.h
│ ├── container_traits.h
│ ├── insert.h
│ └── string.h
├── create.t.cpp
├── dense_map.h
├── dense_map.natvis
├── dense_map.t.cpp
├── enumset.h
├── interval.h
├── interval.t.cpp
├── interval_types.h
├── optional.h
├── optional.t.cpp
├── range/
│ ├── adjacent_adaptor.h
│ ├── cartesian_product_adaptor.h
│ ├── concat_adaptor.h
│ ├── concat_adaptor.t.cpp
│ ├── conditional_range.h
│ ├── conditional_range.t.cpp
│ ├── empty_range.h
│ ├── filter_adaptor.h
│ ├── index_iterator.h
│ ├── index_range.h
│ ├── intersection_adaptor.h
│ ├── intersection_adaptor.t.cpp
│ ├── iota_range.h
│ ├── iterator_cache.h
│ ├── iterator_facade.h
│ ├── join_adaptor.h
│ ├── join_framed_adaptor.h
│ ├── literal_range.h
│ ├── literal_range.t.cpp
│ ├── make_range.h
│ ├── merge_range.h
│ ├── merge_ranges.h
│ ├── merge_ranges.t.cpp
│ ├── meta.h
│ ├── ordered_pairs.h
│ ├── partial_sum.h
│ ├── range.t.cpp
│ ├── range_adaptor.h
│ ├── range_return.h
│ ├── repeat_n.h
│ ├── reverse_adaptor.h
│ ├── reverse_adaptor.t.cpp
│ ├── sparse_adaptor.h
│ ├── sparse_adaptor.t.cpp
│ ├── subrange.h
│ ├── subrange.t.cpp
│ ├── take_while.h
│ ├── take_while.t.cpp
│ ├── transform.h
│ ├── transform.t.cpp
│ ├── transform_adaptor.h
│ ├── union_adaptor.h
│ ├── unique_range_adaptor.h
│ ├── zip_range.h
│ └── zip_range.t.cpp
├── restricted_enum.h
├── restricted_enum.t.cpp
├── static_vector.h
├── storage_for.h
├── string/
│ ├── ascii.h
│ ├── char.h
│ ├── char.t.cpp
│ ├── convert_enc.h
│ ├── convert_enc.t.cpp
│ ├── format.h
│ ├── jsonparser.h
│ ├── jsonparser.t.cpp
│ ├── make_c_str.h
│ ├── make_c_str.t.cpp
│ ├── named.h
│ ├── parserbase.h
│ ├── spirit/
│ │ ├── support/
│ │ │ ├── assert_msg.hpp
│ │ │ ├── char_encoding/
│ │ │ │ ├── ascii.hpp
│ │ │ │ ├── iso8859_1.hpp
│ │ │ │ ├── standard.hpp
│ │ │ │ ├── standard_wide.hpp
│ │ │ │ ├── unicode/
│ │ │ │ │ ├── category_table.hpp
│ │ │ │ │ ├── lowercase_table.hpp
│ │ │ │ │ ├── query.hpp
│ │ │ │ │ ├── script_table.hpp
│ │ │ │ │ └── uppercase_table.hpp
│ │ │ │ └── unicode.hpp
│ │ │ └── char_set/
│ │ │ ├── basic_chset.hpp
│ │ │ ├── range.hpp
│ │ │ ├── range_functions.hpp
│ │ │ ├── range_run.hpp
│ │ │ └── range_run_impl.hpp
│ │ ├── unittest/
│ │ │ ├── actions.t.cpp
│ │ │ ├── alternative.t.cpp
│ │ │ ├── and_predicate.t.cpp
│ │ │ ├── attr.t.cpp
│ │ │ ├── attribute_type_check.t.cpp
│ │ │ ├── binary.t.cpp
│ │ │ ├── bool.hpp
│ │ │ ├── bool.t.cpp
│ │ │ ├── char1.t.cpp
│ │ │ ├── char_class.t.cpp
│ │ │ ├── confix.t.cpp
│ │ │ ├── container_support.t.cpp
│ │ │ ├── difference.t.cpp
│ │ │ ├── eoi.t.cpp
│ │ │ ├── eol.t.cpp
│ │ │ ├── eps.t.cpp
│ │ │ ├── error_handler.t.cpp
│ │ │ ├── expect.t.cpp
│ │ │ ├── extract_int.t.cpp
│ │ │ ├── fusion_map.t.cpp
│ │ │ ├── grammar.hpp
│ │ │ ├── grammar.t.cpp
│ │ │ ├── grammar_linker.t.cpp
│ │ │ ├── int.hpp
│ │ │ ├── int1.t.cpp
│ │ │ ├── iterator_check.t.cpp
│ │ │ ├── kleene.t.cpp
│ │ │ ├── lexeme.t.cpp
│ │ │ ├── list.t.cpp
│ │ │ ├── lit.t.cpp
│ │ │ ├── lit1.t.cpp
│ │ │ ├── lit2.t.cpp
│ │ │ ├── matches.t.cpp
│ │ │ ├── no_case.t.cpp
│ │ │ ├── no_skip.t.cpp
│ │ │ ├── not_predicate.t.cpp
│ │ │ ├── omit.t.cpp
│ │ │ ├── optional_x3.t.cpp
│ │ │ ├── plus.t.cpp
│ │ │ ├── raw.t.cpp
│ │ │ ├── real.hpp
│ │ │ ├── real1.t.cpp
│ │ │ ├── real2.t.cpp
│ │ │ ├── real3.t.cpp
│ │ │ ├── real4.t.cpp
│ │ │ ├── repeat.t.cpp
│ │ │ ├── rule1.t.cpp
│ │ │ ├── rule2.t.cpp
│ │ │ ├── rule3.t.cpp
│ │ │ ├── rule4.t.cpp
│ │ │ ├── rule_separate_tu.t.cpp
│ │ │ ├── rule_separate_tu_grammar.hpp
│ │ │ ├── rule_separate_tu_grammar.t.cpp
│ │ │ ├── seek.t.cpp
│ │ │ ├── sequence.t.cpp
│ │ │ ├── skip.t.cpp
│ │ │ ├── symbols1.t.cpp
│ │ │ ├── symbols2.t.cpp
│ │ │ ├── symbols3.t.cpp
│ │ │ ├── test.hpp
│ │ │ ├── to_utf8.t.cpp
│ │ │ ├── tst.t.cpp
│ │ │ ├── uint.hpp
│ │ │ ├── uint1.t.cpp
│ │ │ ├── uint_radix.hpp
│ │ │ ├── uint_radix.t.cpp
│ │ │ ├── unused_type.t.cpp
│ │ │ ├── utils.hpp
│ │ │ ├── with.t.cpp
│ │ │ └── x3_variant.t.cpp
│ │ ├── x3/
│ │ │ ├── auxiliary/
│ │ │ │ ├── attr.hpp
│ │ │ │ ├── eoi.hpp
│ │ │ │ ├── eol.hpp
│ │ │ │ ├── eps.hpp
│ │ │ │ └── guard.hpp
│ │ │ ├── auxiliary.hpp
│ │ │ ├── binary/
│ │ │ │ └── binary.hpp
│ │ │ ├── binary.hpp
│ │ │ ├── char/
│ │ │ │ ├── any_char.hpp
│ │ │ │ ├── char.hpp
│ │ │ │ ├── char_class.hpp
│ │ │ │ ├── char_class_tags.hpp
│ │ │ │ ├── char_parser.hpp
│ │ │ │ ├── char_set.hpp
│ │ │ │ ├── detail/
│ │ │ │ │ └── cast_char.hpp
│ │ │ │ ├── literal_char.hpp
│ │ │ │ ├── negated_char_parser.hpp
│ │ │ │ └── unicode.hpp
│ │ │ ├── char.hpp
│ │ │ ├── core/
│ │ │ │ ├── action.hpp
│ │ │ │ ├── call.hpp
│ │ │ │ ├── detail/
│ │ │ │ │ └── parse_into_container.hpp
│ │ │ │ ├── parse.hpp
│ │ │ │ ├── parser.hpp
│ │ │ │ ├── proxy.hpp
│ │ │ │ └── skip_over.hpp
│ │ │ ├── core.hpp
│ │ │ ├── directive/
│ │ │ │ ├── confix.hpp
│ │ │ │ ├── expect.hpp
│ │ │ │ ├── lexeme.hpp
│ │ │ │ ├── matches.hpp
│ │ │ │ ├── no_case.hpp
│ │ │ │ ├── no_skip.hpp
│ │ │ │ ├── omit.hpp
│ │ │ │ ├── raw.hpp
│ │ │ │ ├── repeat.hpp
│ │ │ │ ├── seek.hpp
│ │ │ │ ├── skip.hpp
│ │ │ │ └── with.hpp
│ │ │ ├── directive.hpp
│ │ │ ├── nonterminal/
│ │ │ │ ├── debug_handler_state.hpp
│ │ │ │ ├── detail/
│ │ │ │ │ ├── rule.hpp
│ │ │ │ │ └── transform_attribute.hpp
│ │ │ │ ├── rule.hpp
│ │ │ │ └── simple_trace.hpp
│ │ │ ├── nonterminal.hpp
│ │ │ ├── numeric/
│ │ │ │ ├── bool.hpp
│ │ │ │ ├── bool_policies.hpp
│ │ │ │ ├── int.hpp
│ │ │ │ ├── real.hpp
│ │ │ │ ├── real_policies.hpp
│ │ │ │ └── uint.hpp
│ │ │ ├── numeric.hpp
│ │ │ ├── operator/
│ │ │ │ ├── alternative.hpp
│ │ │ │ ├── and_predicate.hpp
│ │ │ │ ├── detail/
│ │ │ │ │ ├── alternative.hpp
│ │ │ │ │ └── sequence.hpp
│ │ │ │ ├── difference.hpp
│ │ │ │ ├── kleene.hpp
│ │ │ │ ├── list.hpp
│ │ │ │ ├── not_predicate.hpp
│ │ │ │ ├── optional.hpp
│ │ │ │ ├── plus.hpp
│ │ │ │ └── sequence.hpp
│ │ │ ├── operator.hpp
│ │ │ ├── string/
│ │ │ │ ├── detail/
│ │ │ │ │ ├── string_parse.hpp
│ │ │ │ │ └── tst.hpp
│ │ │ │ ├── literal_string.hpp
│ │ │ │ ├── symbols.hpp
│ │ │ │ ├── tst.hpp
│ │ │ │ └── tst_map.hpp
│ │ │ ├── string.hpp
│ │ │ ├── support/
│ │ │ │ ├── ast/
│ │ │ │ │ ├── position_tagged.hpp
│ │ │ │ │ └── variant.hpp
│ │ │ │ ├── context.hpp
│ │ │ │ ├── no_case.hpp
│ │ │ │ ├── numeric_utils/
│ │ │ │ │ ├── detail/
│ │ │ │ │ │ └── extract_int.hpp
│ │ │ │ │ ├── extract_int.hpp
│ │ │ │ │ ├── extract_real.hpp
│ │ │ │ │ └── pow10.hpp
│ │ │ │ ├── subcontext.hpp
│ │ │ │ ├── traits/
│ │ │ │ │ ├── attribute_category.hpp
│ │ │ │ │ ├── attribute_of.hpp
│ │ │ │ │ ├── attribute_of_binary.hpp
│ │ │ │ │ ├── attribute_type.hpp
│ │ │ │ │ ├── container_traits.hpp
│ │ │ │ │ ├── handles_container.hpp
│ │ │ │ │ ├── has_attribute.hpp
│ │ │ │ │ ├── is_range.hpp
│ │ │ │ │ ├── is_substitute.hpp
│ │ │ │ │ ├── is_variant.hpp
│ │ │ │ │ ├── move_to.hpp
│ │ │ │ │ ├── numeric_traits.hpp
│ │ │ │ │ ├── optional_traits.hpp
│ │ │ │ │ ├── print_attribute.hpp
│ │ │ │ │ ├── print_token.hpp
│ │ │ │ │ ├── pseudo_attribute.hpp
│ │ │ │ │ ├── string_traits.hpp
│ │ │ │ │ ├── transform_attribute.hpp
│ │ │ │ │ ├── tuple_traits.hpp
│ │ │ │ │ ├── variant_find_substitute.hpp
│ │ │ │ │ └── variant_has_substitute.hpp
│ │ │ │ ├── unused.hpp
│ │ │ │ └── utility/
│ │ │ │ ├── annotate_on_success.hpp
│ │ │ │ ├── error_reporting.hpp
│ │ │ │ ├── is_callable.hpp
│ │ │ │ ├── lambda_visitor.hpp
│ │ │ │ ├── sfinae.hpp
│ │ │ │ └── utf8.hpp
│ │ │ └── version.hpp
│ │ └── x3.hpp
│ ├── spirit.h
│ ├── spirit_algorithm.h
│ ├── xmlparser.h
│ ├── xmlparser.t.cpp
│ └── xmltransform.h
├── tuple.h
├── unittest.h
├── variant.h
└── variant.t.cpp
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
* text=auto
================================================
FILE: .github/workflows/main.yml
================================================
name: CI
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
image: ["gcc:13", "clang:16"]
config: [Debug, Release]
runs-on: ubuntu-latest
container:
image: ghcr.io/think-cell/${{matrix.image}}
steps:
- uses: actions/checkout@v4
- name: Setup Boost
shell: bash
run: |
curl -L https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.zip --output boost_1_83_0.zip
unzip -q boost_1_83_0.zip
mv boost_1_83_0/ boost/
- name: CMake configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DBoost_INCLUDE_DIR=$GITHUB_WORKSPACE/boost/ -DBoost_LIBRARY_DIR=$GITHUB_WORKSPACE/boost/
- name: Compile
run: cmake --build build
- name: Run
run: cmake --build build --target test
================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.21)
project(
tc_library_test
VERSION 1.0
LANGUAGES C CXX
)
set(CMAKE_CXX_STANDARD 20)
# cmake -S . -B build -DBoost_INCLUDE_DIR=C:\Libraries\boost_1_79_0/ -DBoost_LIBRARY_DIR=C:\Libraries\boost_1_79_0/
find_package(Boost 1.75 REQUIRED)
# Generate one cpp file per header
file(
GLOB_RECURSE liststrLibrary
LIST_DIRECTORIES false
CONFIGURE_DEPENDS
RELATIVE ${CMAKE_SOURCE_DIR}/tc
${CMAKE_SOURCE_DIR}/tc/*.h
)
set(liststrLibraryCpp "")
foreach(strLibrary ${liststrLibrary})
set(strLibraryCpp ${CMAKE_BINARY_DIR}/test/${strLibrary}.cpp)
list(APPEND liststrLibraryCpp ${strLibraryCpp})
file(WRITE ${strLibraryCpp}
"#include " \"${strLibrary}\"
)
endforeach()
file(WRITE ${CMAKE_BINARY_DIR}/test/main.cpp
"int main() { return 0; }"
)
# Test if each header compiles individually
add_executable(compile_test ${liststrLibraryCpp} ${CMAKE_BINARY_DIR}/test/main.cpp)
target_include_directories(compile_test PRIVATE ${CMAKE_SOURCE_DIR}/tc)
target_link_libraries(compile_test Boost::boost Boost::disable_autolinking)
# Run unit tests
include(CTest)
list(APPEND CMAKE_CTEST_ARGUMENTS "--verbose")
file(
GLOB_RECURSE liststrUnitTestFiles
LIST_DIRECTORIES false
CONFIGURE_DEPENDS
${CMAKE_SOURCE_DIR}/tc/*.t.cpp
)
add_executable(unit_test ${liststrUnitTestFiles} ${CMAKE_BINARY_DIR}/test/main.cpp)
target_include_directories(unit_test PRIVATE ${CMAKE_SOURCE_DIR}/tc)
target_link_libraries(unit_test Boost::boost Boost::disable_autolinking)
add_test(NAME unit_test COMMAND unit_test)
add_executable(example_test range.example.cpp)
target_link_libraries(example_test Boost::boost Boost::disable_autolinking)
add_test(NAME example_test COMMAND example_test)
================================================
FILE: LICENSE_1_0.txt
================================================
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
[](https://github.com/think-cell/range/actions/workflows/main.yml)
think-cell public library
=========================
This library consists of several core C++ utilities that we at *think-cell Software* have developed and consider to be useful.
It mostly covers ranges, but you will see that it also contains other handy features.
We continuously improve our library as part of our daily work, and whenever we gain new insights, we add them as we go.
To get in touch with other programmers, we regularly [give talks about our ideas](https://www.think-cell.com/career/talks/overview.shtml), using this library as a reference.
We consider the library to be production-quality code, but it is important to know that we do not strive for stable interfaces. Being free of such constraints is an important requirement for further enhancements.
Clean and expressive code makes reasoning about it - and thus further progress - easier. Therefore, we adopt the latest language features quickly if it helps the case.
This library has been made publicly available as an example of modern C++ coding techniques and as a source of inspiration for other library writers. And of course because we are proud of it!
The documentation is currently lacking and we are working on that. We will publish usage examples on our new [developer blog](https://www.think-cell.com/devblog) and will merge them into the library as comments.
-------------
Contributions
-------------
If you propose a change that improves correctness or standard-conformance, we encourage you to make a pull request.
But please understand that, for the above-mentioned reasons, we are not keen on workarounds to accommodate outdated compilers.
Does hacking our library give you a kick, and do you think you can contribute more? We are a friendly and driven bunch of C++ enthusiasts with a knack for elegant algorithms, and we are always looking for [new colleagues](https://www.think-cell.com/career).
------------------
Usage instructions
------------------
You need to have boost installed (we tested with [1.75.0](https://www.boost.org/users/history/version_1_75_0.html)) and the following compiler settings:
##### Visual C++ 19.28 (Visual Studio 2019 16.9)
* `/std:c++latest`
##### clang (*13.0.0* and *Apple LLVM 14.0.0*)
* `-std=c++2a`
##### gcc 12
* `-std=c++2a`
`range.example.cpp` provides a good entry point to get started quickly. If you want to see more examples, there are some unit tests in `tc/*.t.cpp`.
================================================
FILE: range.example.cpp
================================================
// think-cell public library
//
// Copyright (C) 2016-2018 think-cell Software GmbH
//
// 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
#include "tc/range/meta.h"
#include "tc/range/filter_adaptor.h"
#include "tc/string/format.h"
#include "tc/string/make_c_str.h"
#include <boost/range/adaptors.hpp>
#include <vector>
#include <cstdio>
namespace {
template <typename... Args>
void print(Args&&... args) noexcept {
std::printf("%s", tc::implicit_cast<char const*>(tc::make_c_str<char>(std::forward<Args>(args)...)));
}
//---- Basic ------------------------------------------------------------------------------------------------------------------
void basic () {
std::vector<int> v = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
tc::for_each(
tc::filter(v, [](const int& n){ return (n%2==0);}),
[&](auto const& n) {
print(tc::as_dec(n), ", ");
}
);
print("\n");
}
//---- Generator Range --------------------------------------------------------------------------------------------------------
namespace {
struct generator_range {
template< typename Func >
void operator()( Func func ) const& {
for(int i=0;i<50;++i) {
func(i);
}
}
};
}
void ex_generator_range () {
tc::for_each( tc::filter( generator_range(), [](int i){ return i%2==0; } ), [](int i) {
print(tc::as_dec(i), ", ");
});
print("\n");
}
//---- Generator Range (with break) -------------------------------------------------------------------------------------------
namespace {
struct generator_range_break {
template< typename Func >
tc::break_or_continue operator()( Func func ) const& {
using namespace tc;
for(int i=0;i<5000;++i) {
if (func(i)==break_) { return break_; }
}
return continue_;
}
};
}
void ex_generator_range_break () {
tc::for_each( tc::filter( generator_range_break(), [](int i){ return i%2==0; } ), [](int i) -> tc::break_or_continue {
print(tc::as_dec(i), ", ");
return (i>=50)? tc::break_ : tc::continue_;
});
print("\n");
}
//---- Stacked filters --------------------------------------------------------------------------------------------------------
void stacked_filters() {
tc::for_each( tc::filter( tc::filter( tc::filter(
generator_range_break(),
[](int i){ return i%2!=0; } ),
[](int i){ return i%3!=0; } ),
[](int i){ return i%5!=0; } )
, [](int i) -> tc::break_or_continue
{
print(tc::as_dec(i), ", ");
return (i>25)? tc::break_ : tc::continue_;
});
print("\n");
}
}
int main() {
print("-- Running Examples ----------\n");
basic();
ex_generator_range();
ex_generator_range_break();
stacked_filters();
using namespace tc;
int av[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
auto v = std::vector<int> (av, av+sizeof(av)/sizeof(int));
//---- filter example with iterators -------------------------------------------
auto r = tc::filter( tc::filter( tc::filter(
v,
[](int i){ return i%2!=0; } ),
[](int i){ return i%3!=0; } ),
[](int i){ return i%5!=0; } );
for (auto it = std::begin(r),
end = std::end(r);
it != end;
++it)
{
print(tc::as_dec(*it), ", ");
}
print("\n");
//---- boost for comparison -----------------------------------------------------
auto br = v | boost::adaptors::filtered([](int i){ return i%2!=0; })
| boost::adaptors::filtered([](int i){ return i%3!=0; })
| boost::adaptors::filtered([](int i){ return i%5!=0; });
for (auto it = std::begin(br),
end = std::end(br);
it != end;
++it)
{
print(tc::as_dec(*it), ", ");
}
print("\n");
print("-- Done ----------\n");
std::fflush(stdout);
return EXIT_SUCCESS;
}
================================================
FILE: tc/algorithm/accumulate.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "for_each.h"
#include "../base/modified.h"
#include "../optional.h"
namespace tc {
/////////////////////////////////////////////////////
// accumulate
namespace no_adl {
template< typename T, typename AccuOp >
struct accumulate_fn /*final*/ {
T * m_pt;
AccuOp * m_paccuop;
constexpr accumulate_fn( T & t, AccuOp & accuop ) noexcept
: m_pt(std::addressof(t)), m_paccuop(std::addressof(accuop))
{}
template<typename S>
constexpr auto operator()(S&& s) const& MAYTHROW {
return tc::continue_if_not_break(*m_paccuop, *m_pt, tc_move_if_owned(s));
}
};
}
template< typename Rng, typename T, typename AccuOp >
[[nodiscard]] constexpr T accumulate(Rng&& rng, T t, AccuOp accuop) MAYTHROW {
tc::for_each(tc_move_if_owned(rng), no_adl::accumulate_fn<T,AccuOp>(t,accuop));
return t;
}
namespace no_adl {
template< typename T, typename AccuOp >
struct [[nodiscard]] accumulator_with_front /*final*/ {
std::optional<T> & m_t;
AccuOp m_accuop;
template< typename S >
constexpr auto operator()( S&& s ) const& MAYTHROW {
return tc_conditional_prvalue_as_val(
m_t,
tc::continue_if_not_break( m_accuop, *m_t, tc_move_if_owned(s) ),
TC_FWD(tc::optional_emplace(m_t, tc_move_if_owned(s)), tc::constant<tc::continue_>())
);
}
};
}
template<typename Value, typename AccuOp>
constexpr no_adl::accumulator_with_front<Value, AccuOp> make_accumulator_with_front(std::optional<Value>& value, AccuOp&& accumulate) noexcept {
return {value, tc_move_if_owned(accumulate)};
}
template<typename T, typename Rng, typename AccuOp>
[[nodiscard]] constexpr std::optional<T> accumulate_with_front(Rng&& rng, AccuOp&& accuop) MAYTHROW {
static_assert(tc::decayed<T>);
std::optional<T> t;
tc::for_each(tc_move_if_owned(rng), tc::make_accumulator_with_front(t, tc_move_if_owned(accuop)));
return t;
}
template<typename Rng, typename AccuOp>
[[nodiscard]] constexpr auto accumulate_with_front(Rng&& rng, AccuOp&& accuop) MAYTHROW {
return tc::accumulate_with_front<tc::range_value_t<Rng>>(tc_move_if_owned(rng), tc_move_if_owned(accuop));
}
}
================================================
FILE: tc/algorithm/algorithm.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../base/assert_defs.h"
#include "../base/functors.h"
#include "../base/tag_type.h"
#include "../range/adjacent_adaptor.h"
#include "../range/make_range.h"
#include "../range/meta.h"
#include "../range/join_framed_adaptor.h"
#include "../range/subrange.h"
#include "../range/unique_range_adaptor.h"
#include "../range/iota_range.h"
#include "../range/concat_adaptor.h"
#include "../range/filter_adaptor.h"
#include "../container/container_traits.h"
#include "../container/container.h" // tc::vector
#include "../container/cont_assign.h"
#include "../container/insert.h"
#include "../container/cont_reserve.h"
#include "../storage_for.h"
#include "../string/spirit.h"
#include "append.h"
#include "size.h"
#include "element.h"
#include "equal.h"
#include "quantifier.h"
#include "empty.h"
#include "minmax.h"
#include "compare.h"
#include "for_each_xxx.h"
#include "accumulate.h"
#include "size_bounded.h"
#include "find.h"
#include "filter_inplace.h"
#include "best_element.h"
#include "partition_iterator.h"
#include "partition_range.h"
#include "size_linear.h"
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/utility.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/multi_index_container_fwd.hpp>
#include <boost/multi_index/hashed_index_fwd.hpp>
#include <boost/multi_index/ordered_index_fwd.hpp>
#include <boost/intrusive/set.hpp>
#include <type_traits>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
namespace tc {
template< typename Rng, typename Less = tc::fn_less>
[[nodiscard]] constexpr bool is_strictly_sorted(Rng const& rng, Less less = Less()) noexcept {
return tc::all_of(tc::adjacent<2>(rng), [&](auto const& first, auto const& second) noexcept {
return less(first, second);
});
}
template< typename Rng, typename Less = tc::fn_less>
[[nodiscard]] constexpr bool is_sorted(Rng const& rng, Less less = Less()) MAYTHROW {
return !tc::any_of(tc::adjacent<2>(rng), [&](auto const& first, auto const& second) MAYTHROW {
return less(second, first); // MAYTHROW
});
}
/////////////////////////////////
// associative containers
namespace explicit_convert_adl {
template<typename TTarget, typename Rng>
requires has_mem_fn_lower_bound<TTarget> || has_mem_fn_hash_function<TTarget>
TTarget explicit_convert_impl(adl_tag_t, std::type_identity<TTarget>, Rng&& rng) noexcept {
TTarget cont;
// force each element to be inserted
tc::cont_must_insert_range(cont, tc_move_if_owned(rng));
return cont;
}
}
/////////////////////////////////////////////////////
// sort
#ifdef __clang__
namespace constexpr_sort_inplace_detail {
// This duplicates the functionality of tc::sort, which cannot be used in a constant expression,
// because it uses std::sort which is not constexpr (until C++20).
template<typename Iterator, typename Pred>
constexpr void constexpr_sort_inplace(Iterator itBegin, Iterator itEnd, Pred pred) noexcept {
#if defined(_CHECKS) && defined(TC_PRIVATE)
int nIterationCount = 0;
#endif
while (1 < itEnd - itBegin) {
_ASSERTENOTIFY( ++nIterationCount <= 32 ); // Do we actually run into O(n^2) complexity?
auto itPartitionBegin = itBegin;
auto itPartitionEnd = tc_modified(itEnd, --_);
// Any iterator in the interval [itBegin, itEnd - 2] works.
// Middle is best for sorted and reverse sorted ranges.
auto itPivotElement = tc::middle_point(itBegin, itPartitionEnd);
for (;;) {
while (pred(*itPartitionBegin, *itPivotElement)) {
++itPartitionBegin;
}
while (pred(*itPivotElement, *itPartitionEnd)) {
--itPartitionEnd;
}
if (itPartitionEnd <= itPartitionBegin) {
break;
}
if (itPartitionBegin == itPivotElement) {
itPivotElement = itPartitionEnd;
} else if (itPartitionEnd == itPivotElement) {
itPivotElement = itPartitionBegin;
}
tc::swap(*itPartitionBegin, *itPartitionEnd);
++itPartitionBegin;
--itPartitionEnd;
}
auto const itSplitPoint = itPartitionEnd + 1;
#if defined(_CHECKS) && defined(_DEBUG)
_ASSERTE(itBegin < itSplitPoint);
_ASSERTE(itSplitPoint < itEnd);
for (auto j = itBegin; j < itSplitPoint; ++j) {
_ASSERTE(!pred(*itPivotElement, *j));
}
for (auto j = itSplitPoint; j < itEnd; ++j) {
_ASSERTE(!pred(*j, *itPivotElement));
}
#endif
// Recur into smaller subrange and sort larger subrange in next iteration to get O(log n) space complexity.
if( itSplitPoint - itBegin < itEnd - itSplitPoint ) {
constexpr_sort_inplace_detail::constexpr_sort_inplace(itBegin, itSplitPoint, pred);
itBegin = itSplitPoint;
} else {
constexpr_sort_inplace_detail::constexpr_sort_inplace(itSplitPoint, itEnd, pred);
itEnd = itSplitPoint;
}
}
}
}
#endif
template<typename Rng, typename Less = tc::fn_less>
constexpr void sort_inplace(Rng&& rng, Less&& less = Less()) noexcept(noexcept(less(tc::front(rng), tc::front(rng)))) {
if constexpr( has_mem_fn_sort< Rng >) {
static_assert( std::is_lvalue_reference<Rng>::value );
rng.sort( tc_move_if_owned(less) );
} else {
#ifdef __clang__ // xcode12 does not support constexpr std::sort
if(std::is_constant_evaluated()) {
constexpr_sort_inplace_detail::constexpr_sort_inplace(tc::begin(rng), tc::end(rng), less);
_ASSERTE( tc::is_sorted(rng, less) );
} else {
#endif
std::sort( tc::begin(rng), tc::end(rng), tc_move_if_owned(less) );
#ifdef __clang__
}
#endif
}
}
template<typename Rng, typename Less = tc::fn_less>
void stable_sort_inplace(Rng&& rng, Less&& less = Less()) noexcept(noexcept(less(tc::front(rng), tc::front(rng)))) {
std::stable_sort(tc::begin(rng), tc::end(rng), tc_move_if_owned(less));
}
template< typename Less=tc::fn_less >
constexpr void strictly_sort_inplace(auto&& rng, Less less=Less()) noexcept(noexcept(less(tc::front(rng), tc::front(rng)))) {
tc::sort_inplace(rng, less);
_ASSERT( tc::is_strictly_sorted(rng, less) );
}
namespace no_adl {
template<typename Rng, bool bStable>
struct [[nodiscard]] sorted_index_adaptor final
: tc::range_adaptor_base_range<Rng>
, tc::index_range_adaptor<
sorted_index_adaptor<Rng, bStable>,
tc::vector<tc::index_t<std::remove_reference_t<Rng>>>,
index_range_adaptor_flags::inherit_begin_end | index_range_adaptor_flags::inherit_traversal
>
, private tc::nonmovable // disable copy ctor and default move ctor
{
private:
using this_type = sorted_index_adaptor;
using base_range_base = tc::range_adaptor_base_range<Rng>;
using index_base = typename this_type::index_range_adaptor;
public:
using base_range_base::base_range;
using typename index_base::tc_index;
static constexpr bool c_bHasStashingIndex=false;
template<typename LessOrComp>
explicit sorted_index_adaptor(Rng&& rng, LessOrComp lessorcomp) noexcept
: base_range_base(tc::aggregate_tag, tc_move_if_owned(rng))
, index_base(tc::aggregate_tag, tc::explicit_cast<tc::vector<tc::index_t<std::remove_reference_t<Rng>>>>(
tc::transform(tc::make_range_of_iterators(base_range()), tc_fn(tc::iterator2index<Rng>))
))
{
tc::sort_inplace(
this->index_base::base_range(),
[&](auto const& idxLhs, auto const& idxRhs ) noexcept -> bool {
tc_auto_cref(lhs, tc::dereference_index(base_range(), idxLhs));
tc_auto_cref(rhs, tc::dereference_index(base_range(), idxRhs));
if constexpr (bStable) {
static_assert(tc::random_access_range<Rng>);
tc_auto_cref(order, lessorcomp(lhs, rhs));
static_assert(tc::is_comparison_category<std::remove_cvref_t<decltype(order)>>);
if(tc::is_eq(order)) {
return 0<tc::distance_to_index(base_range(), idxLhs, idxRhs);
} else if(std::is_lt(order)) {
return true;
} else {
_ASSERTDEBUG(std::is_gt(order));
return false;
}
} else {
return lessorcomp(lhs, rhs);
}
}
);
}
sorted_index_adaptor(sorted_index_adaptor&& src) noexcept requires tc::stable_index_on_move<Rng> // tc::reference_or_value is movable for const Rng as well
: base_range_base(tc::base_cast<base_range_base>(tc_move(src)))
, index_base(tc::base_cast<index_base>(tc_move(src)))
{}
private:
STATIC_FINAL(dereference_index)(tc_index const& idx) const& return_decltype_MAYTHROW(
tc::dereference_index(base_range(), *idx)
)
STATIC_FINAL(dereference_index)(tc_index const& idx) & return_decltype_MAYTHROW(
tc::dereference_index(base_range(), *idx)
)
public:
static decltype(auto) element_base_index(tc_index const& idx) noexcept {
return *idx;
}
static decltype(auto) element_base_index(tc_index&& idx) noexcept {
return *tc_move(idx);
}
constexpr decltype(auto) dereference_untransform(tc_index const& idx) const& noexcept {
return base_range().dereference_untransform(*idx);
}
};
}
using no_adl::sorted_index_adaptor;
template<typename Rng, typename Less = tc::fn_less>
[[nodiscard]] auto sorted_iterator_range(Rng& rng, Less&& less = Less()) noexcept {
auto vecitSorted=tc::make_vector( tc::make_range_of_iterators(rng) );
tc::sort_inplace(vecitSorted, tc::projected( tc_move_if_owned(less), tc::fn_indirection() ) );
return vecitSorted;
}
template<typename Rng, typename Less = tc::fn_less>
[[nodiscard]] auto sort(Rng&& rng, Less&& less = Less()) noexcept {
return tc::sorted_index_adaptor<Rng, false/*bStable*/>(tc_move_if_owned(rng), tc_move_if_owned(less));
}
template<typename Rng, typename Less = tc::fn_less>
[[nodiscard]] constexpr auto constexpr_sort(Rng&& rng, Less&& less = Less()) noexcept {
auto a = tc::make_array(tc_move_if_owned(rng));
tc::sort_inplace(a, tc_move_if_owned(less));
return a;
}
template<typename Rng, typename Comp = tc::fn_compare>
[[nodiscard]] auto stable_sort(Rng&& rng, Comp&& comp = Comp()) noexcept {
return tc::sorted_index_adaptor<Rng, true/*bStable*/>(tc_move_if_owned(rng), tc_move_if_owned(comp));
}
namespace no_adl {
template< typename Rng >
struct [[nodiscard]] untransform_adaptor
: tc::index_range_adaptor<
untransform_adaptor<Rng>,
Rng, tc::index_range_adaptor_flags::inherit_begin_end | tc::index_range_adaptor_flags::inherit_traversal
>
{
private:
using this_type = untransform_adaptor;
using base_ = typename untransform_adaptor::index_range_adaptor;
public:
using typename base_::tc_index;
using base_::base_;
STATIC_FINAL_MOD(template<typename Index> constexpr, dereference_index)(Index&& idx) & return_decltype_MAYTHROW(
this->base_range().dereference_untransform(tc_move_if_owned(idx))
)
STATIC_FINAL_MOD(template<typename Index> constexpr, dereference_index)(Index&& idx) const& return_decltype_MAYTHROW(
this->base_range().dereference_untransform(tc_move_if_owned(idx))
)
};
}
template<typename Rng>
[[nodiscard]] auto untransform(Rng&& rng) noexcept {
return no_adl::untransform_adaptor<Rng>(tc::aggregate_tag, tc_move_if_owned(rng));
}
///////////////////////////////////////
// partition ranges into subranges
template<typename Rng, typename Less = tc::fn_less>
[[nodiscard]] auto ordered_unique_range(Rng&& rng, Less&& less = Less()) noexcept {
_ASSERTDEBUG( tc::is_sorted( rng, less ) );
return tc::adjacent_unique_range( tc_move_if_owned(rng), std::not_fn( tc_move_if_owned(less) ) );
}
template<typename Rng, typename FuncRngStart, typename FuncRngElement, typename Less = tc::fn_less>
auto generator_ordered_unique_range(Rng&& rng, FuncRngStart funcStart, FuncRngElement funcElem, Less&& less = Less()) noexcept {
std::optional<tc::range_value_t<Rng>> oelem;
tc::for_each(tc_move_if_owned(rng), [&](auto&& element) noexcept {
if (!oelem || less(*oelem, element)) {
tc_return_if_break(tc::continue_if_not_break(funcStart))
tc::optional_emplace(oelem, element);
}
return tc::continue_if_not_break(funcElem,tc_move_if_owned(element));
});
}
template<typename Rng, typename Comp = tc::fn_compare>
[[nodiscard]] auto stable_sort_unique_range(Rng&& rng, Comp const& comp = Comp()) noexcept {
return tc::ordered_unique_range( tc::stable_sort( tc_move_if_owned(rng), comp ), tc::lessfrom3way(comp) );
}
template<typename Rng, typename Less = tc::fn_less>
[[nodiscard]] auto sort_unique_range(Rng&& rng, Less const& less = Less()) noexcept {
return tc::ordered_unique_range( tc::sort( tc_move_if_owned(rng), less ), less );
}
template<typename Rng, typename Less = tc::fn_less>
[[nodiscard]] auto sort_inplace_unique_range(Rng&& rng, Less&& less = Less()) noexcept {
static_assert( !std::is_reference<Rng>::value );
tc::sort_inplace( rng, std::ref(less) );
return tc::ordered_unique_range( tc_move_if_owned(rng), tc_move_if_owned(less) );
}
template< typename Rng, typename Less, typename Accu >
void accumulate_each_unique_range(Rng&& cont, Less less, Accu accu) noexcept {
range_filter< tc::decay_t<Rng> > rngfilter( cont );
tc::for_each(
tc::ordered_unique_range(
cont,
tc_move(less)
),
[&accu,&rngfilter]( auto const& rngEqualSubRange ) noexcept {
for(
auto it=tc::begin_next<tc::return_border>(rngEqualSubRange);
it!=tc::end(rngEqualSubRange);
++it
) {
tc_invoke(accu,*tc::begin(rngEqualSubRange), *it);
}
rngfilter.keep( tc::begin(rngEqualSubRange) );
}
);
}
template< typename Rng, typename Less, typename Accu >
void sort_accumulate_each_unique_range(Rng&& cont, Less less, Accu accu) noexcept {
tc::sort_inplace( cont, less );
tc::accumulate_each_unique_range(cont, tc_move(less), tc_move(accu));
}
template< typename Cont, typename Equals = decltype(tc::equal_to)>
void front_unique_inplace(Cont& cont, Equals&& pred={}) noexcept(noexcept(pred(tc::front(cont), tc::front(cont)))) {
tc::range_filter< tc::decay_t<Cont> > rngfilter(cont);
tc::for_each(
tc::transform(
tc::front_unique_range(cont, tc_move_if_owned(pred)),
tc_fn(tc::begin)
),
[&](auto it) noexcept {
rngfilter.keep(tc_move(it));
}
);
}
/*
In contrast to std::unique, tc::adjacent_unique / tc::adjacent_unique_inplace always compares adjacent elements. This allows implementing
bidirectional tc::adjacent_unique, with tc::adjacent_unique_inplace yielding the same result.
*/
template< typename Cont, typename Equals=decltype(tc::equal_to)>
constexpr void adjacent_unique_inplace(Cont & cont, Equals&& pred={}) noexcept(noexcept(pred(tc::front(cont), tc::front(cont)))) {
tc::range_filter< tc::decay_t<Cont> > rngfilter(cont);
// When this function is evaluated at compile time, the range returned by tc::make_range_of_iterators cannot use an rvalue as a base range.
// This is because it stores the base range in a mutable field inside tc::reference_or_value.
tc::for_each(
tc::may_remove_current(tc::make_range_of_iterators(tc::as_lvalue(tc::adjacent_unique(cont, tc_move_if_owned(pred/*MAYTHROW*/))))),
[&](auto it) noexcept {
rngfilter.keep(it.element_base());
}
);
}
template<typename Cont, typename Less=tc::fn_less>
constexpr void ordered_unique_inplace( Cont& cont, Less less=Less() ) noexcept(noexcept(less(tc::front(cont), tc::front(cont)))) {
_ASSERTDEBUG( tc::is_sorted( cont, less ) );
tc::adjacent_unique_inplace( cont, std::not_fn( tc_move(less) ) );
}
template< typename Cont, typename Less=tc::fn_less >
constexpr void sort_unique_inplace(Cont& cont, Less less=Less()) noexcept(noexcept(less(tc::front(cont), tc::front(cont)))) {
tc::sort_inplace( cont, less );
tc::ordered_unique_inplace( cont, tc_move(less) );
}
template< typename Cont, typename Less=tc::fn_less >
void stable_sort_unique_inplace(Cont& cont, Less less=Less()) noexcept(noexcept(less(tc::front(cont), tc::front(cont)))) {
tc::stable_sort_inplace( cont, less );
tc::ordered_unique_inplace( cont, tc_move(less) );
}
template<typename Rng, typename Less>
auto ordered_unique_begin_and_count(Rng&& rng, Less&& less) noexcept {
return tc::transform(tc::ordered_unique_range( tc_move_if_owned(rng), tc_move_if_owned(less)), [&](auto const& rngSub) noexcept {
return std::make_pair(
tc::begin(rngSub),
tc::implicit_cast<typename boost::range_size< std::remove_reference_t<Rng> >::type >(tc::size_linear(rngSub))
);
});
}
template<typename RangeReturn, typename Rng>
[[nodiscard]] auto plurality_element(Rng&& rng) noexcept {
auto vecitSorted = tc::sorted_iterator_range(rng, tc::fn_less()); // do not inline, oit->first points into vecitSorted
if(auto oit = tc::max_element<tc::return_value_or_none>(
tc::ordered_unique_begin_and_count(
vecitSorted,
tc::projected(tc::fn_less(), fn_indirection())
),
tc_member(.second)
)) {
return RangeReturn::pack_element(tc_move_always(*oit->first), tc_move_if_owned(rng));
} else {
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
}
}
template< typename RangeReturn, typename Rng, typename Pred >
[[nodiscard]] decltype(auto) trim_left_if(Rng&& rng, Pred&& pred) MAYTHROW {
static_assert( RangeReturn::allowed_if_always_has_border );
return tc_rewrap_temporary(Rng&&, RangeReturn::pack_border(
tc::find_first_if<tc::return_border_before_or_end>( tc_unwrap_temporary(rng), std::not_fn(tc_move_if_owned(pred)) ),
tc_unwrap_temporary(tc_move_if_owned(rng))
));
}
template< typename RangeReturn, typename Rng, typename Pred >
[[nodiscard]] decltype(auto) trim_right_if(Rng&& rng, Pred&& pred) MAYTHROW {
static_assert( RangeReturn::allowed_if_always_has_border );
return tc_rewrap_temporary(Rng&&, RangeReturn::pack_border(
tc::find_last_if<tc::return_border_after_or_begin>( tc_unwrap_temporary(rng), std::not_fn(tc_move_if_owned(pred)) ),
tc_unwrap_temporary(tc_move_if_owned(rng))
));
}
template< typename Rng, typename Pred >
[[nodiscard]] decltype(auto) trim_if(Rng&& rng, Pred&& pred) MAYTHROW {
return tc_invoke(tc::chained(
// clang crashes if we use return_decltype_allow_xvalue
[&](auto&& rng) -> decltype(auto) { return tc::trim_left_if<tc::return_drop>(tc_move_if_owned(rng), tc_move_if_owned(pred)); },
[&](auto&& rng) -> decltype(auto) { return tc::trim_right_if<tc::return_take>(tc_move_if_owned(rng), pred); }
), tc_move_if_owned(rng));
}
template< typename RangeReturn, typename Rng, typename RngTrim >
[[nodiscard]] decltype(auto) trim_left(Rng&& rng, RngTrim const& rngTrim) MAYTHROW {
return tc::trim_left_if<RangeReturn>( tc_move_if_owned(rng), [&](auto const& _) noexcept { return tc::find_first<tc::return_bool>(rngTrim, _); } );
}
template< typename RangeReturn, typename Rng, typename RngTrim >
[[nodiscard]] decltype(auto) trim_right(Rng&& rng, RngTrim const& rngTrim) MAYTHROW {
return tc::trim_right_if<RangeReturn>( tc_move_if_owned(rng), [&](auto const& _) noexcept { return tc::find_first<tc::return_bool>(rngTrim, _); } );
}
template< typename Rng, typename RngTrim >
[[nodiscard]] decltype(auto) trim(Rng&& rng, RngTrim const& rngTrim) MAYTHROW {
return tc::trim_if( tc_move_if_owned(rng), [&](auto const& _) noexcept { return tc::find_first<tc::return_bool>(rngTrim, _); } );
}
template< typename Rng, typename T >
[[nodiscard]] bool contains_single(Rng const& rng, T const& t) noexcept {
return 1==size_bounded(rng,2) && tc::front( rng )==t;
}
namespace cont_find_detail {
template< typename RangeReturn, typename Cont>
decltype(auto) cont_find_impl(Cont& cont, tc::iterator_t< Cont > it) noexcept {
if( it==tc::end(cont) ) {
return RangeReturn::pack_no_element(
cont
);
} else {
return RangeReturn::pack_element(
it,
cont
);
}
}
}
template< typename RangeReturn, typename Cont, typename Arg >
[[nodiscard]] decltype(auto) cont_find(Cont& cont, Arg&& arg) noexcept {
return cont_find_detail::cont_find_impl<RangeReturn>(cont, cont.find(tc_move_if_owned(arg)));
}
#ifdef _DEBUG
using static_vector_size_t = std::uint32_t; // fixed width integer for shared heap
namespace static_vector_adl {
template< typename T, tc::static_vector_size_t N> struct static_vector;
}
using static_vector_adl::static_vector;
#endif
template<typename Rng>
void assert_no_null_terminator(Rng const& rng) noexcept {
if constexpr( tc::char_type< tc::range_value_t<Rng const&> > ) {
_ASSERT( !tc::find_first<tc::return_bool>(rng, tc::explicit_cast<tc::range_value_t<Rng const&>>('\0') ));
}
}
template<typename Rng>
void remove_null_terminator(Rng& rng) noexcept {
static_assert( tc::char_type< tc::range_value_t<decltype((rng))> > );
_ASSERTEQUAL( tc::back(rng), tc::explicit_cast< tc::range_value_t<decltype((rng))> >('\0') );
tc::drop_last_inplace(rng);
tc::assert_no_null_terminator(rng);
}
template<typename Char, std::size_t N>
[[nodiscard]] constexpr Char const* take_null_terminated(Char const (&ach)[N]) noexcept {
static_assert( tc::char_type<Char> );
_ASSERTDEBUG( tc::find_first<tc::return_bool>(tc::as_array(ach), Char()) );
return ach;
}
namespace get_buffer_detail {
#if defined(TC_PRIVATE) && defined(_DEBUG) && !defined(__clang__)
namespace no_adl {
template<typename Cont>
struct container_with_sentinel final {
using type = Cont;
};
template<typename T, tc::static_vector_size_t N>
struct container_with_sentinel<tc::static_vector<T, N>> final {
using type = tc::static_vector<T, N + 1>;
};
}
#endif
/* Calls func(pBuffer, nBufferSize) with buffers of increasing size; func may read into
[pBuffer, pBuffer+nBufferSize) and return nSize, which is either the correct size of the
buffer (if nSize <= nBufferSize) or an estimate otherwise. */
template<typename Cont, typename Func>
void append_buffer_allowing_nulls(Cont& cont, Func func) MAYTHROW {
auto const nOffset = tc::size(cont);
#if defined(TC_PRIVATE) && defined(_DEBUG) && !defined(__clang__)
tc::cont_reserve(cont, tc::size(cont)+1);
#endif
for (;;) {
tc::cont_extend(cont, cont.capacity(), boost::container::default_init); // Allow func to use the whole allocated buffer
// sentinel to detect buffer overrun
IF_NO_MSVC_WORKAROUND(static) constexpr typename boost::range_size<Cont>::type nSentinel= // workaround MSVC compiler bug: https://developercommunity.visualstudio.com/t/code-generation-bug-on-static-variable-i/10541326
#if defined(TC_PRIVATE) && defined(_DEBUG) && !defined(__clang__)
1;
_ASSERT(nOffset+nSentinel <= tc::size(cont));
tc::for_each(tc::begin_next<tc::return_drop>(cont, nOffset), tc_fn(UNINITIALIZED));
#else
0;
#endif
auto const nNeededBufferSize = func(tc::ptr_begin(cont)+nOffset, tc::size(cont)-nOffset-nSentinel);
#if defined(TC_PRIVATE) && defined(_DEBUG) && !defined(__clang__)
tc::assert_uninitialized(tc::back(cont));
#endif
auto const nSize = nOffset + nNeededBufferSize;
if (nSize+nSentinel <= tc::size(cont)) {
_ASSERT(0 <= nSize);
tc::take_first_inplace(cont, nSize);
IF_TC_CHECKS(if (!tc::empty(cont)) _ASSERTINITIALIZED(tc::back(cont));)
return;
}
tc::take_first_inplace(cont, nOffset);
tc::cont_reserve(cont, nSize+nSentinel); // The container must grow bigger, but let cont_reserve decide by how much
}
}
/* Calls func(pBuffer, nBufferSize) with buffers of increasing size; func may read into
[pBuffer, pBuffer+nBufferSize) and return nSize, which is either the correct size of the
buffer (if nSize <= nBufferSize) or an estimate otherwise. */
template<typename Cont, typename Func>
Cont get_buffer_allowing_nulls(Func&& func) MAYTHROW {
static_assert(tc::decayed<Cont>);
// sentinel to detect buffer overrun
#if defined(TC_PRIVATE) && defined(_DEBUG) && !defined(__clang__)
typename no_adl::container_with_sentinel<Cont>::type
#else
Cont
#endif
cont;
if (0 == cont.capacity()) {
tc::cont_reserve(cont, 8);
}
append_buffer_allowing_nulls(cont, tc_move_if_owned(func));
if constexpr (std::is_same<Cont, decltype(cont)>::value) {
return cont;
} else {
tc_return_cast( tc_move(cont) );
}
}
template<typename Cont, typename Func>
Cont get_truncating_buffer_allowing_nulls(Func func) noexcept {
return tc::get_buffer_detail::get_buffer_allowing_nulls<Cont>([&](auto pBuffer, auto const nBufferSize) noexcept {
auto nSize = func(pBuffer, nBufferSize);
if (nSize == nBufferSize) {
return nSize+1; // Any return value larger than nBufferSize causes a retry with a larger buffer
} else {
_ASSERT(nSize < nBufferSize);
return nSize;
}
});
}
}
template<typename Cont, typename Func>
[[nodiscard]] Cont get_truncating_buffer(Func&& func) noexcept {
auto cont=tc::get_buffer_detail::get_truncating_buffer_allowing_nulls<Cont>(tc_move_if_owned(func));
tc::assert_no_null_terminator(cont);
return cont;
}
template<typename Cont, typename Func>
[[nodiscard]] Cont get_truncating_null_terminated_buffer(Func&& func) noexcept {
auto cont=tc::get_buffer_detail::get_truncating_buffer_allowing_nulls<Cont>(tc_move_if_owned(func));
tc::remove_null_terminator(cont);
return cont;
}
template<typename Cont, typename Func>
[[nodiscard]] Cont get_buffer(Func&& func) MAYTHROW {
auto cont=tc::get_buffer_detail::get_buffer_allowing_nulls<Cont>(tc_move_if_owned(func)); // MAYTHROW
tc::assert_no_null_terminator(cont);
return cont;
}
template<typename Cont, typename Func>
void append_buffer(Cont& cont, Func&& func) MAYTHROW {
IF_TC_CHECKS(auto const nOffset = tc::size(cont));
tc::get_buffer_detail::append_buffer_allowing_nulls<Cont>(cont, tc_move_if_owned(func)); // MAYTHROW
IF_TC_CHECKS(tc::assert_no_null_terminator(tc::begin_next<tc::return_drop>(cont, nOffset)));
}
template<typename Cont, typename Func>
[[nodiscard]] Cont get_null_terminated_buffer(Func&& func) MAYTHROW {
auto cont=tc::get_buffer_detail::get_buffer_allowing_nulls<Cont>(tc_move_if_owned(func)); // MAYTHROW
static_assert( tc::char_type< tc::range_value_t<decltype((cont))> > );
tc::remove_null_terminator(cont);
return cont;
}
template<typename Cont, typename Func>
[[nodiscard]] Cont get_buffer_may_be_null_terminated(Func&& func) MAYTHROW {
auto cont = tc::get_buffer_detail::get_buffer_allowing_nulls<Cont>(tc_move_if_owned(func)); // MAYTHROW
static_assert( tc::char_type< tc::range_value_t<decltype((cont))> > );
tc::take_inplace(cont, tc::ends_with<tc::return_border_or_end>(cont, tc::single(tc::explicit_cast< tc::range_value_t<decltype((cont))> >('\0'))));
tc::assert_no_null_terminator(cont);
return cont;
}
template<typename... MultiIndexArgs, typename K, typename... ValueTypeCtorArgs >
std::pair< tc::iterator_t<boost::multi_index::detail::hashed_index<MultiIndexArgs...>>, bool >
multi_index_try_emplace_with_key(boost::multi_index::detail::hashed_index<MultiIndexArgs...>& hashed_index, K const& key, ValueTypeCtorArgs&& ... valuetypectorargs) MAYTHROW
{
if(auto it = tc::cont_find<tc::return_element_or_null>(hashed_index, key)) {
return std::make_pair(tc_move(it), false);
} else {
return hashed_index.emplace(tc_move_if_owned(valuetypectorargs)...); // MAYTHROW
}
}
template<typename... MultiIndexArgs, typename K, typename... ValueTypeCtorArgs >
std::pair< tc::iterator_t<boost::multi_index::detail::ordered_index<MultiIndexArgs...>>, bool >
multi_index_try_emplace_with_key(boost::multi_index::detail::ordered_index<MultiIndexArgs...>& ordered_index, K const& key, ValueTypeCtorArgs&& ... valuetypectorargs) MAYTHROW
{
auto it = ordered_index.lower_bound(key);
if (tc::end(ordered_index)==it || ordered_index.key_comp()(key, ordered_index.key_extractor()(*it))) {
return std::make_pair(
tc::cont_must_emplace_before(ordered_index, tc_move(it), tc_move_if_owned(valuetypectorargs)...), // MAYTHROW
true
);
} else {
return std::make_pair(tc_move(it), false);
}
}
template<typename... MultiIndexArgs, typename K>
std::pair<tc::iterator_t<boost::multi_index::detail::hashed_index<MultiIndexArgs...>>, bool>
map_query_cache(boost::multi_index::detail::hashed_index<MultiIndexArgs...>& hashed_index, K&& key) MAYTHROW {
if (auto it = tc::cont_find<tc::return_element_or_null>(hashed_index, tc::as_const(key))) {
return std::make_pair(tc_move(it), false);
} else {
return hashed_index.emplace(tc_move_if_owned(key)); // MAYTHROW
}
}
template<typename Cont, typename Key>
void cont_must_erase(Cont& cont, Key&& key) noexcept {
VERIFYEQUAL( cont.erase(tc_move_if_owned(key)), 1u );
}
template<typename Cont, typename Key>
bool cont_try_erase(Cont& cont, Key&& key) noexcept {
switch_no_default(cont.erase(tc_move_if_owned(key))) {
case 0: return false;
case 1: return true;
};
}
template< typename Cont, typename SubRng >
void cont_erase_range(Cont& cont, SubRng const& rng) noexcept {
cont.erase(tc::begin(rng), tc::end(rng));
}
/////////////////////////////////////////////////////
// remove_count_erase
template<typename Cont, typename Pred>
[[nodiscard]]
typename tc::size_proxy< typename boost::range_size<Cont>::type > remove_count_erase_if(Cont& cont, Pred pred) noexcept {
typename boost::range_size<Cont>::type count=0;
tc::filter_inplace( cont, [&]( auto&& t ) noexcept ->bool {
bool const b=tc_invoke(pred, tc_move_if_owned(t));
count += (b ? 1 : 0);
return !b;
} );
return tc::size_proxy< typename boost::range_size<Cont>::type >(count);
}
template<typename Cont, typename T>
[[nodiscard]]
typename tc::size_proxy< typename boost::range_size<Cont>::type > remove_count_erase(Cont& cont, T const& t) noexcept {
return remove_count_erase_if( cont, [&](auto const& _) noexcept { return tc::equal_to(_, t); } );
}
/////////////////////////////////////////////////////
// reverse_inplace
// inplace algorithms should accept only lvalue containers, but reverse_inplace is called with
// subranges of containers, so it must accept rvalues.
template<typename Rng>
constexpr void reverse_inplace(Rng&& rng) noexcept {
if constexpr( has_mem_fn_reverse<std::remove_reference_t<Rng>> ) {
rng.reverse();
} else {
std::reverse(tc::begin(rng), tc::end(rng));
}
}
template<typename Rng, typename Less>
[[nodiscard]] auto ordered_unique(Rng&& rng, Less less) noexcept code_return_decltype (
_ASSERTDEBUG( tc::is_sorted( rng, less ) );,
tc::adjacent_unique( tc_move_if_owned(rng), std::not_fn( tc_move(less) ) )
)
template<typename Rng>
[[nodiscard]] auto ordered_unique(Rng&& rng) return_decltype_noexcept(
tc::ordered_unique( tc_move_if_owned(rng), tc::fn_less() )
)
template<typename Rng, typename Less = tc::fn_less>
[[nodiscard]] auto sort_inplace_unique(Rng&& rng, Less less = Less()) noexcept code_return_decltype(
static_assert( !std::is_reference<Rng>::value );
tc::sort_inplace( rng, less );,
tc::ordered_unique( tc_move_if_owned(rng), tc_move(less) )
)
template<typename Rng, typename Less>
[[nodiscard]] auto sort_unique(Rng&& rng, Less less) return_decltype_noexcept(
tc::ordered_unique(tc::sort(tc_move_if_owned(rng), less), less)
)
template<typename Rng>
[[nodiscard]] auto sort_unique(Rng&& rng) return_decltype_noexcept(
sort_unique(tc_move_if_owned(rng), tc::fn_less())
)
template<typename Rng, typename Less=tc::fn_less>
[[nodiscard]] constexpr auto constexpr_sort_unique(Rng&& rng, Less&& less=Less()) noexcept {
return tc_modified(
tc::make_static_vector<tc::constexpr_size<Rng>()>(tc_move_if_owned(rng)),
tc::sort_unique_inplace(_, tc_move_if_owned(less))
);
}
namespace find_first_or_unique_adl {
template< typename RangeReturn, IF_TC_CHECKS(bool c_bCheckUnique,) typename T, T... t, typename U >
[[nodiscard]] constexpr decltype(auto) find_first_or_unique_impl(adl_tag_t, IF_TC_CHECKS(tc::constant<c_bCheckUnique>,) std::integer_sequence<T, t...>, U const& u) noexcept {
#ifdef _CHECKS
if constexpr (c_bCheckUnique) {
// This assert is stronger than the usual find_unique precondition, which allows duplicates as long as they are not searched for.
static_assert( tc::is_strictly_sorted(tc::constexpr_sort(tc::make_array(tc::aggregate_tag, t...))) );
}
#endif
return ((tc::equal_to(t, u)) || ...);
}
}
template< typename RangeReturn, typename SetType, typename T, typename Less >
void binary_find_unique(tc::unordered_set<SetType> const& rng, T const& t, Less less) noexcept = delete;
namespace binary_find_first_or_unique_adl {
template< typename RangeReturn, bool c_bAssertUniqueness, typename Rng, typename T, typename Pred >
[[nodiscard]] decltype(auto) binary_find_first_or_unique(Rng&& rng, T const& t, Pred predLessOr3way) noexcept {
// The result of tc::binary_find_unique must be unambiguous. In general, this means that rng is strictly
// ordered. In some cases, it is convenient to allow multiple occurrences of the same item in
// rng, which is not a problem as long as these items are not searched for.
// preserve order of arguments for 3way predicates
auto const c_b3way = tc::is_comparison_category<decltype(predLessOr3way(tc::front(rng), t))>; // tc_static_auto_constexpr_capture causes ICE
auto it=[&]() noexcept {
if constexpr(c_b3way) {
_ASSERTDEBUG( tc::is_sorted(rng, tc::lessfrom3way(std::ref(predLessOr3way))) );
return tc::lower_bound<tc::return_border>( rng, t, tc::lessfrom3way(std::ref(predLessOr3way)) );
} else {
_ASSERTDEBUG( tc::is_sorted(rng, predLessOr3way) );
return tc::lower_bound<tc::return_border>( rng, t, std::ref(predLessOr3way) );
}
}();
if( it==tc::end( rng ) ) {
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
} else {
auto const Greater = [&](auto const& elem) noexcept {
if constexpr(c_b3way) {
return std::is_gt(predLessOr3way(elem, t));
} else {
return predLessOr3way(t, elem);
}
};
auto && ref=*it;
if (Greater(tc::as_const(ref))) {
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
} else {
#ifdef _CHECKS
if constexpr(c_bAssertUniqueness) {
auto itNext = tc_modified(it, ++_);
_ASSERT( tc::end(rng)==itNext || Greater(tc::as_const(*itNext)));
}
#endif
return RangeReturn::pack_element(it,tc_move_if_owned(rng),tc_move_if_owned(ref));
}
}
}
}
template< typename RangeReturn, typename Rng, typename T, typename Pred >
[[nodiscard]] decltype(auto) binary_find_unique(Rng&& rng, T const& t, Pred predLessOr3way) noexcept {
return binary_find_first_or_unique_adl::binary_find_first_or_unique<RangeReturn, /*c_bAssertUniqueness*/ true>(tc_move_if_owned(rng), t, tc_move(predLessOr3way));
}
template< typename RangeReturn, typename Rng, typename T >
[[nodiscard]] decltype(auto) binary_find_unique(Rng&& rng, T const& t) noexcept {
return tc::binary_find_unique<RangeReturn>( tc_move_if_owned(rng), t, tc::fn_less() );
}
template< typename RangeReturn, typename Rng, typename T, typename Pred >
[[nodiscard]] decltype(auto) binary_find_first(Rng&& rng, T const& t, Pred predLessOr3way) noexcept {
return binary_find_first_or_unique_adl::binary_find_first_or_unique<RangeReturn, /*c_bAssertUniqueness*/ false>(tc_move_if_owned(rng), t, tc_move(predLessOr3way));
}
template< typename RangeReturn, typename Rng, typename T >
[[nodiscard]] decltype(auto) binary_find_first(Rng&& rng, T const& t) noexcept {
return tc::binary_find_first<RangeReturn>( tc_move_if_owned(rng), t, tc::fn_less() );
}
// would be cleaner to search on the distance metric (starting with lower_bound(rng,0)),
// but subtraction may cause unnecessary overflows
template< typename Rng, typename T >
[[nodiscard]] auto binary_closest(Rng&& rng, T const& t) noexcept {
auto it = tc::lower_bound<tc::return_border>(rng, t);
if( tc::begin(rng)==it ) {
return it;
} else if( tc::end(rng)==it ) {
return tc_modified(it, --_);
} else {
auto itPrior = tc_modified(it, --_);
return (t - *itPrior) < (*it - t) ? itPrior : it;
}
}
template< typename RngA, typename RngB, typename Comp, typename FuncElementA, typename FuncElementB, typename FuncElementBoth >
auto interleave_may_remove_current_iterator(RngA&& rngA, RngB&& rngB, Comp comp, FuncElementA fnElementA, FuncElementB fnElementB, FuncElementBoth fnElementBoth) noexcept -> tc::common_type_t<
decltype(tc::continue_if_not_break(fnElementA, tc::begin(rngA), tc::begin(rngB))),
decltype(tc::continue_if_not_break(fnElementB, tc::begin(rngA), tc::begin(rngB))),
decltype(tc::continue_if_not_break(fnElementBoth, tc::begin(rngA), tc::begin(rngB)))
> {
auto itA=tc::begin(rngA);
auto itEndA=tc::end(rngA);
auto itB=tc::begin(rngB);
auto itEndB=tc::end(rngB);
if( itA==itEndA ) goto endA;
if( itB==itEndB ) goto endB;
for(;;) {
if(tc_auto_cref(order, comp( tc::as_const(*itA), tc::as_const(*itB) )); std::is_lt(order)) {
tc_return_if_break(tc::continue_if_not_break(fnElementA, itA++, itB))
if( itA==itEndA ) goto endA;
} else if(tc::is_eq(order)) {
tc_return_if_break(tc::continue_if_not_break(fnElementBoth, itA++, itB++))
if( itA==itEndA ) goto endA;
if( itB==itEndB ) goto endB;
} else {
_ASSERTDEBUG(std::is_gt(order));
tc_return_if_break(tc::continue_if_not_break(fnElementB, itA, itB++))
if( itB==itEndB ) goto endB;
}
}
endB:
while (itA != itEndA) tc_return_if_break(tc::continue_if_not_break(fnElementA, itA++, itEndB))
tc_return_cast(tc::continue_);
endA:
while(itB != itEndB) tc_return_if_break(tc::continue_if_not_break(fnElementB, itEndA, itB++))
tc_return_cast(tc::continue_);
}
template< typename RngA, typename RngB, typename Comp, typename FuncElementA, typename FuncElementB, typename FuncElementBoth >
auto interleave_may_remove_current(RngA&& rngA, RngB&& rngB, Comp comp, FuncElementA fnElementA, FuncElementB fnElementB, FuncElementBoth fnElementBoth) noexcept {
return interleave_may_remove_current_iterator(rngA, rngB, comp,
[&](auto const& lhs, tc::unused /*rhs*/) noexcept { return tc_invoke(fnElementA, *lhs); },
[&](tc::unused /*lhs*/, auto const& rhs) noexcept { return tc_invoke(fnElementB, *rhs); },
[&](auto const& lhs, auto const& rhs) noexcept { return tc_invoke(fnElementBoth, *lhs, *rhs); }
);
}
namespace interleave_2_detail {
DEFINE_TAG_TYPE(lhs_tag)
DEFINE_TAG_TYPE(rhs_tag)
DEFINE_TAG_TYPE(lhsrhs_tag)
namespace no_adl {
// MSVC (from 15.8 to 17.0.2) sometimes crashes when this is inlined as a lambda in interleave_2.
template<typename RngRhs, typename Comp, typename Sink>
struct interleave_2_sink {
tc::iterator_t<RngRhs>& m_itrhs;
tc::sentinel_t<RngRhs> const& m_endrhs;
Comp const m_comp;
Sink const& m_sink;
template<typename Lhs>
constexpr auto operator()(Lhs&& lhs) const& MAYTHROW -> tc::common_type_t<
decltype(tc::continue_if_not_break(m_sink, lhs_tag, std::declval<Lhs>())),
decltype(tc::continue_if_not_break(m_sink, rhs_tag, *m_itrhs)),
decltype(tc::continue_if_not_break(m_sink, lhsrhs_tag, std::declval<Lhs>(), *m_itrhs)),
tc::constant<tc::continue_>
> {
for (;;) {
if( m_itrhs == m_endrhs ) {
return tc::continue_if_not_break(m_sink, lhs_tag, tc_move_if_owned(lhs));
} else {
decltype(auto) rhs = *m_itrhs;
if(auto const order=tc_invoke(m_comp, tc::as_const(lhs), tc::as_const(rhs) ); std::is_lt(order)) {
return tc::continue_if_not_break(m_sink, lhs_tag, tc_move_if_owned(lhs));
} else if (std::is_gt(order)) {
tc_return_if_break(tc::continue_if_not_break(m_sink, rhs_tag, tc_move_if_owned(rhs)))
++m_itrhs;
} else {
tc_return_if_break(tc::continue_if_not_break(m_sink, lhsrhs_tag, tc_move_if_owned(lhs), tc_move_if_owned(rhs)))
++m_itrhs;
return tc::constant<tc::continue_>();
}
}
}
}
};
template<typename SinkLhs, typename SinkRhs, typename SinkLhsRhs>
struct SDemultiplexByTagSink { // MSVC workaround: not a lambda for shorter symbol names
SinkLhs const m_sinklhs;
SinkRhs const m_sinkrhs;
SinkLhsRhs const m_sinklhsrhs;
template<typename... Args>
constexpr auto operator()(lhs_tag_t, Args&&... args) const& return_decltype_MAYTHROW( m_sinklhs(tc_move_if_owned(args)...) )
template<typename... Args>
constexpr auto operator()(rhs_tag_t, Args&&... args) const& return_decltype_MAYTHROW( m_sinkrhs(tc_move_if_owned(args)...) )
template<typename... Args>
constexpr auto operator()(lhsrhs_tag_t, Args&&... args) const& return_decltype_MAYTHROW( m_sinklhsrhs(tc_move_if_owned(args)...) )
};
template<typename Sink>
struct SExchangedRangeSink { // MSVC workaround: not a lambda for shorter symbol names
Sink const m_sink;
template<typename Rhs>
constexpr auto operator()(lhs_tag_t, Rhs&& rhs) const& return_decltype_MAYTHROW( tc_invoke(m_sink, rhs_tag, tc_move_if_owned(rhs)) )
template<typename Lhs>
constexpr auto operator()(rhs_tag_t, Lhs&& lhs) const& return_decltype_MAYTHROW( tc_invoke(m_sink, lhs_tag, tc_move_if_owned(lhs)) )
template<typename Rhs, typename Lhs>
constexpr auto operator()(lhsrhs_tag_t, Rhs&& rhs, Lhs&& lhs) const& return_decltype_MAYTHROW( tc_invoke(m_sink, lhsrhs_tag, tc_move_if_owned(lhs), tc_move_if_owned(rhs)) )
};
template<typename Comp>
struct SExchangedRangeComp { // MSVC workaround: not a lambda for shorter symbol names
Comp const m_comp;
constexpr auto operator()(auto const& rhs, auto const& lhs) const& MAYTHROW {
return tc::negate(tc_invoke(m_comp, lhs, rhs));
}
};
}
template< typename RngLhs, tc::range_with_iterators RngRhs, typename Comp, typename Sink>
requires tc::prefers_for_each<RngLhs> || (!tc::prefers_for_each<RngRhs>)
constexpr auto internal_interleave_2(RngLhs&& rnglhs, RngRhs&& rngrhs, Comp&& comp, Sink const sink) MAYTHROW {
auto itrhs=tc::begin(rngrhs);
auto endrhs=tc::end(rngrhs);
tc_return_if_break(tc::for_each(
rnglhs,
no_adl::interleave_2_sink<RngRhs, decay_t<Comp>, Sink>{itrhs, endrhs, tc_move_if_owned(comp), sink}
));
while (itrhs != endrhs) {
tc_return_if_break(tc::continue_if_not_break(sink, rhs_tag, *itrhs))
++itrhs;
}
return tc::implicit_cast<decltype(tc::for_each(rnglhs,
std::declval<no_adl::interleave_2_sink<RngRhs, tc::decay_t<Comp>, Sink>>()
))>(tc::constant<tc::continue_>());
}
template< tc::range_with_iterators RngLhs, tc::prefers_for_each RngRhs, typename Comp, typename Sink>
requires (!tc::prefers_for_each<RngLhs>)
constexpr auto internal_interleave_2(RngLhs&& rnglhs, RngRhs&& rngrhs, Comp&& comp, Sink&& sink) MAYTHROW {
return interleave_2_detail::internal_interleave_2(
tc_move_if_owned(rngrhs),
tc_move_if_owned(rnglhs),
no_adl::SExchangedRangeComp<tc::decay_t<Comp>>{tc_move_if_owned(comp)},
no_adl::SExchangedRangeSink<tc::decay_t<Sink>>{tc_move_if_owned(sink)}
);
}
}
template<typename SinkLhs, typename SinkRhs, typename SinkLhsRhs>
constexpr auto interleave_2(auto&& rnglhs, auto&& rngrhs, auto&& comp, SinkLhs&& sinklhs, SinkRhs&& sinkrhs, SinkLhsRhs&& sinklhsrhs) MAYTHROW {
return interleave_2_detail::internal_interleave_2(
tc_move_if_owned(rnglhs),
tc_move_if_owned(rngrhs),
tc_move_if_owned(comp),
interleave_2_detail::no_adl::SDemultiplexByTagSink<tc::decay_t<SinkLhs>, tc::decay_t<SinkRhs>, tc::decay_t<SinkLhsRhs>>{
tc_move_if_owned(sinklhs),
tc_move_if_owned(sinkrhs),
tc_move_if_owned(sinklhsrhs)
}
);
}
namespace no_adl {
template<typename Compare>
struct SInterleaveImpl {
tc::decay_t<Compare> m_compare;
bool HasBetterElement(bool* const, tc::unused) const& noexcept {
return false;
}
template<
typename PairItItBest,
typename PairItIt0,
typename... Args
>
bool HasBetterElement(bool* const itb, PairItItBest const& argBest, PairItIt0 const& pairitit0, Args const&... args) const& noexcept {
if (pairitit0.first != pairitit0.second) {
if(tc_auto_cref(order, m_compare(tc::as_const(*argBest.first), tc::as_const(*pairitit0.first))); std::is_lt(order)) {
*itb = false;
return HasBetterElement(tc_modified(itb, ++_), argBest, args...);
} else if(tc::is_eq(order)) {
bool b = HasBetterElement(tc_modified(itb, ++_), argBest, args...);
*itb = !b;
return b;
} else {
_ASSERTDEBUG(std::is_gt(order));
*itb = !HasBetterElement(tc_modified(itb, ++_), pairitit0, args...);
return true;
}
} else {
*itb = false;
return HasBetterElement(tc_modified(itb, ++_), argBest, args...);
}
}
bool FindBest(bool* const) const& {
return false;
}
template<
typename PairItIt0,
typename... Args
>
bool FindBest(bool* const itb, PairItIt0 const& pairitit0, Args const&... args) const& {
if (pairitit0.first != pairitit0.second) {
*itb = !HasBetterElement(tc_modified(itb, ++_), pairitit0, args...);
return true;
} else {
*itb = false;
return FindBest(tc_modified(itb, ++_), args...);
}
}
SInterleaveImpl(Compare&& compare) noexcept
: m_compare(tc_move_if_owned(compare))
{}
template<
typename Func,
std::size_t... I,
typename... PairItIt
>
tc::break_or_continue operator()(Func func, std::index_sequence<I...>, PairItIt... pairitit) const noexcept {
bool ab[sizeof...(PairItIt)];
while (FindBest(tc::begin(ab), pairitit...)) {
tc_return_if_break(tc::continue_if_not_break(func, std::make_pair(pairitit.first, tc::at(ab, I))... ));
([](auto& it, bool const b) noexcept {if (b) ++it;}(pairitit.first, tc::at(ab,I)), ...);
}
return tc::continue_;
}
};
}
template<
typename Compare,
typename Func,
typename... Rng
>
tc::break_or_continue interleave_n(Compare&& compare, Func&& func, Rng&&... rng) noexcept {
return no_adl::SInterleaveImpl<Compare>(tc_move_if_owned(compare))(
tc_move_if_owned(func),
std::index_sequence_for<Rng...>(),
std::make_pair(
tc::begin(rng),
tc::end(rng)
)...
);
}
template <typename RngRng>
[[nodiscard]] auto common_prefix(RngRng&& rngrng) noexcept {
auto&& rngFront = tc::front(rngrng);
return tc::accumulate(
tc::begin_next<tc::return_drop>(rngrng),
tc::take(tc_move_if_owned(rngFront), tc::end(rngFront)),
[&](auto& rngResult, auto const& rng) noexcept {
tc::take_inplace(rngResult, boost::mismatch(rngResult, rng).first);
}
);
}
template< typename T, typename Rng >
[[nodiscard]] auto make_variant_range_filter(Rng&& rng) noexcept {
return tc::transform(
tc::filter(
tc_move_if_owned(rng),
tc_fn(std::holds_alternative<T>)
),
tc_fn(tc::get<T>)
);
}
template< typename RangeReturn, typename Rng, typename T> requires (!RangeReturn::requires_iterator)
[[nodiscard]] constexpr decltype(auto) linear_at(Rng&& rng, T n) noexcept {
return tc::find_first_if<RangeReturn>(tc_move_if_owned(rng), [&](tc::unused) noexcept {
if(0==n) {
return true;
} else {
--n;
return false;
}
});
}
// Create an infinite range by repeatedly applying funcIterate to t
template <typename T, typename FuncIterate>
auto iterate(T&& t, FuncIterate&& funcIterate) noexcept {
return tc::generator_range_output<tc::decay_t<T> const&>([funcIterate=tc::make_reference_or_value(tc_move_if_owned(funcIterate)),t_=tc::make_reference_or_value(tc_move_if_owned(t))](auto func) noexcept {
auto t = *t_;
tc_return_if_break(tc::continue_if_not_break(func,tc::as_const(t)))
for (;;) {
tc_invoke(*funcIterate, t);
tc_return_if_break(tc::continue_if_not_break(func,tc::as_const(t)))
}
});
}
template<typename RngSep, typename... Rngs>
decltype(auto) concat_nonempty_with_separator(RngSep&& rngSep, Rngs&&... rngs) noexcept {
return tc::join_with_separator(
tc_move_if_owned(rngSep),
tc::filter(tc::make_range(tc_move_if_owned(rngs)...), std::not_fn(tc_fn(tc::empty)))
);
}
template<typename RngSep, typename Rng0, typename... Rngs>
decltype(auto) concat_with_separator(RngSep&& rngSep, Rng0&& rng0, Rngs&&... rngs) noexcept {
return tc::concat(tc_move_if_owned(rng0), tc::concat(/*copy if needed*/tc::implicit_cast<RngSep>(rngSep), tc_move_if_owned(rngs))...);
}
template<typename Rng, typename Val>
void fill(Rng&& rng, Val const& value) noexcept {
tc::for_each(tc_move_if_owned(rng), [&](auto&& element) noexcept {
tc_move_if_owned(element) = value;
});
}
}
================================================
FILE: tc/algorithm/algorithm.t.cpp
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#include "../base/assert_defs.h"
#include "../container/container.h" // tc::vector
#include "../unittest.h"
#include "../range/concat_adaptor.h"
#include "../range/join_adaptor.h"
#include "../range/repeat_n.h"
#include "../string/spirit_algorithm.h"
#include "interleave_ranges.h"
#include <random>
namespace {
[[maybe_unused]] void static_tests() noexcept {
// explicit_cast with explicit move constructor
struct SMove { explicit SMove(tc::vector<int>&&) noexcept {} };
void(tc::explicit_cast<SMove>(tc::vector<int>{}));
// explicit_cast with explicit constructor
struct SCopy { explicit SCopy(tc::vector<int>) noexcept {} };
void(tc::explicit_cast<SCopy>(tc::vector<int>{}));
}
UNITTESTDEF( sort_accumulate_each_unique_range_2 ) {
struct SValAccu final {
SValAccu(int val, int accu) noexcept : m_val(val), m_accu(accu) {}
int m_val;
int m_accu;
};
{
tc::vector< SValAccu > vec;
for( int i=0; i < 5; ++i ) {
tc::cont_emplace_back( vec, 1, 1 );
}
tc::sort_accumulate_each_unique_range(
vec,
[](SValAccu const& lhs, SValAccu const& rhs) noexcept { return lhs.m_val < rhs.m_val; },
[](SValAccu& lhs, SValAccu const& rhs) noexcept { lhs.m_accu+=rhs.m_accu; }
);
TEST_EQUAL( 1, vec.size() );
TEST_EQUAL( 1, tc::front(vec).m_val );
TEST_EQUAL( 5, tc::front(vec).m_accu );
}
}
UNITTESTDEF(filter_no_self_assignment_of_rvalues) {
struct S {
S() {}
S(S const&){}
S& operator=(S&& other) {
_ASSERT(&other != this);
return *this;
}
};
tc::vector<S> vs{5,S{}};
tc::sort_accumulate_each_unique_range(
vs,
[&](tc::unused, tc::unused) noexcept {
return false;
},
[&](auto&, tc::unused) noexcept {
}
);
}
UNITTESTDEF( trim_leftright_if ) {
tc::vector<int> v{1,2,3,4,5,6,7,7,7};
decltype(auto) left = tc::trim_left_if<tc::return_drop>(v, [] (int const n) noexcept {return n<4;});
STATICASSERTSAME(decltype(left), tc::iterator_range_t<tc::vector<int>&>);
TEST_RANGE_EQUAL(left, (tc::literal_range_of<4, 5, 6, 7, 7, 7>));
decltype(auto) left_then_right = tc::trim_right_if<tc::return_take>(tc_move(left), [] (int const n) noexcept {return n==7;});
STATICASSERTSAME(decltype(left_then_right), tc::iterator_range_t<tc::vector<int>&>&&);
TEST_RANGE_EQUAL(left_then_right, (tc::literal_range_of<4, 5, 6>));
decltype(auto) both = tc::trim_if(v, [](int const n) { return n < 4 || n == 7; });
STATICASSERTSAME(decltype(both), tc::iterator_range_t<tc::vector<int>&>);
TEST_RANGE_EQUAL(both, (tc::literal_range_of<4, 5, 6>));
decltype(auto) both_prvalue = tc::trim_if(tc::decay_copy(v), [](int const n) { return n < 4 || n == 7; });
STATICASSERTSAME(decltype(both_prvalue), tc::slice_t<tc::vector<int>>);
TEST_RANGE_EQUAL(both_prvalue, (tc::literal_range_of<4, 5, 6>));
}
UNITTESTDEF( is_sorted ) {
{
int a[]={0};
_ASSERT( tc::is_sorted(a) );
}
{
int a[]={0,0};
_ASSERT( tc::is_sorted(a) );
}
{
int a[]={0,1};
_ASSERT( tc::is_sorted(a) );
}
{
int a[]={1,0};
_ASSERT( !tc::is_sorted(a) );
}
{
int a[]={0};
_ASSERT( tc::is_strictly_sorted(a) );
}
{
int a[]={0,0};
_ASSERT( !tc::is_strictly_sorted(a) );
}
{
int a[]={0,1};
_ASSERT( tc::is_strictly_sorted(a) );
}
{
int a[]={1,0};
_ASSERT( !tc::is_strictly_sorted(a) );
}
}
UNITTESTDEF( make_vector_on_r_vector_is_identity ) {
tc::vector<int> v{1,2,3};
auto pvecdata = tc::ptr_begin(v);
auto vNew = tc::make_vector(tc_move(v));
_ASSERTEQUAL(tc::ptr_begin(vNew), pvecdata);
}
UNITTESTDEF(is_strictly_sorted){
int an[]={0,1,2,3,4,5};
_ASSERT(tc::is_strictly_sorted(an));
_ASSERT(!tc::is_strictly_sorted(tc::reverse(an)));
}
UNITTESTDEF(remove_inplace_parser) {
tc::string<char> input = "0123<font>4567<font10><font11><font12>89<font14><font";
tc::remove_inplace(input, tc::lit(tc_ascii("<font")) > *(tc::one<char> - tc::lit(tc_ascii(">"))) > tc::lit(tc_ascii(">")));
_ASSERTEQUAL(input, "0123456789<font");
}
UNITTESTDEF(Naryinterleave) {
tc::vector<int> const vecnA({3,4,7,9});
tc::vector<int> vecnB({2,4,8,9,11,17});
auto const vecnBCopy = vecnB;
tc::vector<int> const vecnC({-100,1000});
tc::vector<int> vecnResult = tc::make_vector(vecnA, vecnB, vecnC);
tc::sort_inplace(vecnResult);
auto itResult = tc::begin(vecnResult);
_ASSERTEQUAL(
tc::continue_,
tc::interleave_n(
tc::fn_compare(),
[&](auto const&... pairitb) noexcept {
auto tplpairitb = tc::tie(pairitb...);
if (tc::get<0>(tplpairitb).second) {
_ASSERTEQUAL(*itResult,*tc::get<0>(tplpairitb).first);
++itResult;
}
if (tc::get<1>(tplpairitb).second) {
_ASSERTEQUAL(*itResult,*tc::get<1>(tplpairitb).first);
*tc::get<1>(tplpairitb).first += 100;
++itResult;
}
if (tc::get<2>(tplpairitb).second) {
_ASSERTEQUAL(*itResult,*tc::get<2>(tplpairitb).first);
++itResult;
}
},
vecnA, vecnB, vecnC
)
);
_ASSERT(tc::equal(
tc::transform(vecnBCopy, [](int const n) noexcept {return n+100;}),
vecnB
));
}
UNITTESTDEF(NaryinterleaveBreak) {
tc::vector<int> const vecnA({ 3,4,7,9 });
tc::vector<int> vecnB({ 2,4,8,9,11,17 });
auto const vecnBCopy = vecnB;
tc::vector<int> const vecnC({ -100,1000 });
tc::vector<int> vecnResult = tc::make_vector(vecnA, vecnB, vecnC);
tc::sort_inplace(vecnResult);
auto itResult = tc::begin(vecnResult);
_ASSERTEQUAL(
tc::break_,
tc::interleave_n(
tc::fn_compare(),
[&](auto const&... pairitb) noexcept {
auto tplpairitb = tc::tie(pairitb...);
if (tc::get<0>(tplpairitb).second) {
_ASSERTEQUAL(*itResult, *tc::get<0>(tplpairitb).first);
++itResult;
if (7 == *tc::get<0>(tplpairitb).first) return tc::break_;
}
if (tc::get<1>(tplpairitb).second) {
_ASSERTEQUAL(*itResult, *tc::get<1>(tplpairitb).first);
*tc::get<1>(tplpairitb).first += 100;
++itResult;
}
if (tc::get<2>(tplpairitb).second) {
_ASSERTEQUAL(*itResult, *tc::get<2>(tplpairitb).first);
++itResult;
}
return tc::continue_;
},
vecnA, vecnB, vecnC
)
);
_ASSERT(tc::equal(
tc::transform(vecnBCopy, [](int const n) noexcept {return n < 7 ? n + 100 : n; }),
vecnB
));
}
UNITTESTDEF(InterleaveRanges) {
tc::vector<tc::vector<int>> const vecvecn({
{1,3,5,7,16,20},
{2,3,5,7,9,17},
{3,7,11,13,17},
{4,5,11,12,16},
{3,7,11,13,17},
{3,4,10,11,16}
});
tc::vector<tc::vector<int>> const vecvecnResult({
{1},
{2},
{3,3,3,3,3},
{4,4},
{5,5,5},
{7,7,7,7},
{9},
{10},
{11,11,11,11},
{12},
{13,13},
{16,16,16},
{17,17,17},
{20}
});
_ASSERT(tc::equal(
tc::make_vector(tc::join(
tc::interleave_ranges(
tc::transform(
tc::iota(1,10),
[](auto const n) noexcept {
return tc::iota(n,10);
}
)
)
)),
tc::make_vector(tc::join(
tc::transform(
tc::iota(1,10),
[](auto const n) noexcept {return tc::repeat_n(n,tc::decay_copy(n));}
)
))
));
_ASSERT(tc::equal(
tc::make_vector(tc::join(tc::interleave_ranges(vecvecn))),
tc::make_vector(tc::join(vecvecnResult))
));
}
UNITTESTDEF(plurality_element_test) {
auto const str = "abcdc";
_ASSERTEQUAL('c', tc::plurality_element<tc::return_value>(str));
auto const str2 = "";
_ASSERTEQUAL(std::nullopt, tc::plurality_element<tc::return_value_or_none>(str2));
auto const str3 = "a";
_ASSERTEQUAL(tc::begin(str3),tc::plurality_element<tc::return_element>(str3));
int an[] = {1,2,3,4,3,4,3,5,6};
_ASSERTEQUAL(std::optional(4), tc::plurality_element<tc::return_value_or_none>(tc::filter(an, [](auto const n) noexcept { return n % 2 == 0; })));
}
static_assert(std::is_move_constructible<decltype(tc::sort(std::declval<tc::string<char> const&>()))>::value);
static_assert(!std::is_move_constructible<decltype(tc::sort(std::declval<tc::string<char>>()))>::value);
static_assert(std::is_move_constructible<decltype(tc::sort(std::declval<tc::vector<int> const&>()))>::value);
static_assert(std::is_move_constructible<decltype(tc::sort(std::declval<tc::vector<int>>()))>::value);
UNITTESTDEF(sort_test) {
tc::vector<int> vec1{6,1,2,9,5,0,3,4,7,8};
_ASSERT(tc::equal(tc::sort(vec1), tc::iota(0, 10)));
auto rngnSorted=tc::sort(tc::vector<int>{3,7,1,9,2,5,8,4,6,0});
_ASSERT(tc::equal(rngnSorted, tc::iota(0, 10)));
tc::vector<std::pair<int, int>> vecpairnn1{{5,0}, {3,0}, {0,0}, {6,0}, {1,0}, {5,1}, {1,1}, {5,2}, {3,1}, {0,1}, {0,2}, {6,1}};
tc::vector<std::pair<int, int>> vecpairnn2{{0,0}, {0,1}, {0,2}, {1,0}, {1,1}, {3,0}, {3,1}, {5,0}, {5,1}, {5,2}, {6,0}, {6,1}};
auto const rngpairnnSorted=tc::stable_sort(tc_move(vecpairnn1),tc::projected(tc::fn_compare(),[](auto const& pairnn) noexcept { return pairnn.first; }));
_ASSERT(tc::equal(rngpairnnSorted, vecpairnn2));
}
#ifdef __clang__ // remove if std::sort is constexpr in xcode
UNITTESTDEF(constexpr_sort_test) {
std::mt19937 gen; // same sequence of numbers each time for reproducibility
std::uniform_int_distribution<> dist(0, 63);
tc_static_auto_constexpr_lambda(Test) = [](auto rngn) noexcept {
auto vecn = tc::explicit_cast<tc::vector<int>>(rngn);
_ASSERTEQUAL(tc_modified(vecn, tc::sort_inplace(_)), tc_modified(vecn, tc::constexpr_sort_inplace_detail::constexpr_sort_inplace(tc::begin(_), tc::end(_), tc::fn_less())));
};
for( int i = 0; i < 17; ++i ) {
Test(tc::begin_next<tc::return_take>([&](auto sink) noexcept { for(;;) tc_return_if_break(tc::continue_if_not_break(sink, dist(gen))); }, dist(gen)));
Test(tc::iota(0, i));
Test(tc::reverse(tc::iota(0, i)));
Test(tc::repeat_n(i, 0));
for( int j = 0; j < 7; ++j) {
Test(tc::join(tc::repeat_n(i, tc::iota(0, j))));
}
}
}
#endif
}
================================================
FILE: tc/algorithm/any_accu.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../base/inplace.h"
namespace tc {
namespace no_adl {
struct any_accu final {
constexpr explicit any_accu() noexcept :
m_b(false)
{}
constexpr explicit any_accu(bool b) noexcept :
m_b(b)
{}
constexpr operator bool() const& noexcept {
return m_b;
}
constexpr void operator()(bool const b) & noexcept {
tc_inplace(m_b) || b;
}
private:
bool m_b;
};
}
using no_adl::any_accu;
}
================================================
FILE: tc/algorithm/append.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../base/assert_defs.h"
#include "../base/construction_restrictiveness.h"
#include "../base/inside_unwinding.h"
#include "../container/container_traits.h"
#include "../container/insert.h"
#include "../container/cont_reserve.h"
#include "../container/container.h"
#include "../container/string.h"
#include "../string/convert_enc.h"
#include "../range/subrange.h"
#include "../range/transform.h"
#include "../range/repeat_n.h"
#include "../range/concat_adaptor.h"
#include <boost/range/algorithm/copy.hpp>
namespace tc {
namespace append_detail {
template<typename Rng, typename TTarget>
concept conv_enc_needed =
tc::char_type<TTarget> &&
tc::range_with_iterators<Rng> &&
tc::char_type<tc::range_value_t<Rng>> &&
!std::is_same<TTarget, tc::range_value_t<Rng>>::value;
// in general, do not use Cont::insert() or Cont(it, it)
// iterators are slower than for_each in many cases (eg. filter ranges)
template<typename Rng, typename Cont>
concept range_insertable =
(!conv_enc_needed<Rng, tc::range_value_t<Cont>>) &&
has_mem_fn_reserve<Cont> &&
tc::common_range<Rng> &&
std::convertible_to<
typename std::iterator_traits<tc::iterator_t<Rng>>::iterator_category,
std::random_access_iterator_tag
> &&
(!tc::prefers_for_each<Rng>) && // it might be more efficient to append by ranges than by iterators
tc::econstructionIMPLICIT==tc::construction_restrictiveness<tc::range_value_t<Cont>, std::iter_reference_t<tc::iterator_t<Rng>>>::value;
}
namespace append_no_adl {
template< typename Cont, bool bReserve = has_mem_fn_reserve<Cont>>
struct [[nodiscard]] appender_type;
template< typename Cont>
struct [[nodiscard]] appender_type<Cont, /*bReserve*/false> {
using guaranteed_break_or_continue = tc::constant<tc::continue_>;
constexpr explicit appender_type(Cont& cont) noexcept: m_cont(cont) {}
Cont& m_cont;
template<typename T>
constexpr void operator()(T&& t) const& noexcept(noexcept(tc::cont_emplace_back(m_cont, tc_move_if_owned(t))))
requires
(!tc::char_like<tc::range_value_t<Cont>> || tc::safely_convertible_to<T&&, tc::range_value_t<Cont>>) &&
requires { tc::cont_emplace_back(std::declval<Cont&>(), tc_move_if_owned(t)); }
{
tc::cont_emplace_back(m_cont, tc_move_if_owned(t)); // MAYTHROW
}
// If appending random-access iterator range, use Cont::insert() to give insert the opportunity for optimizations.
void chunk(append_detail::range_insertable<Cont> auto&& rng) const& noexcept(noexcept(
m_cont.insert(tc::end(m_cont), tc::begin(rng), tc::end(rng))
)) {
NOBADALLOC(m_cont.insert(tc::end(m_cont), tc::begin(rng), tc::end(rng)));
}
void chunk(append_detail::conv_enc_needed<tc::range_value_t<Cont>> auto&& rng) const& return_MAYTHROW(
tc::implicit_cast<void>(tc::for_each(tc::convert_enc<tc::range_value_t<Cont>>(tc_move_if_owned(rng)), *this))
)
template<ENABLE_SFINAE> requires std::is_same<tc::range_value_t<SFINAE_TYPE(Cont)&>, unsigned char>::value
auto write_offset(std::size_t n) const& noexcept {
struct stream_pos_writer final {
Cont& m_cont;
decltype(tc::size_raw(m_cont)) m_pos;
explicit stream_pos_writer(Cont& cont) noexcept
: m_cont(cont)
, m_pos(tc::size_raw(m_cont))
{}
void mark() & noexcept {
// The offset is counted from _after_ the written offset.
boost::copy(tc::as_blob(tc::explicit_cast<std::uint32_t>(tc::size_raw(m_cont)-m_pos-sizeof(std::uint32_t))), tc::begin_next(m_cont, m_pos));
m_pos+=sizeof(std::uint32_t);
}
void mark_null() & noexcept {
boost::copy(tc::as_blob(std::numeric_limits<std::uint32_t>::max()), tc::begin_next(m_cont, m_pos));
m_pos+=sizeof(std::uint32_t);
}
};
stream_pos_writer ow(m_cont);
tc::for_each(tc::repeat_n(sizeof(std::uint32_t)*n, tc::explicit_cast<unsigned char>(0)), *this);
return ow;
}
};
template< typename Cont >
struct [[nodiscard]] appender_type<Cont, /*bReserve*/true> /*final*/: appender_type<Cont, /*bReserve*/false> {
using base_ = appender_type<Cont, /*bReserve*/false>;
using base_::base_;
using base_::chunk;
// We use int = 0 in parameter list because variation of
// https://stackoverflow.com/questions/51933397/sfinae-method-completely-disables-base-classs-template-method-in-clang
template< typename Rng, ENABLE_SFINAE, std::enable_if_t<
!append_detail::conv_enc_needed<Rng, tc::range_value_t<Cont>> &&
tc::has_size<Rng> &&
!append_detail::range_insertable<Rng, Cont>
>* = nullptr>
constexpr auto chunk(Rng&& rng, int = 0) const& return_decltype_MAYTHROW(
tc::cont_reserve(this->m_cont, this->m_cont.size()+tc::size(rng)),
tc::implicit_cast<void>(tc::for_each(tc_move_if_owned(rng), tc::base_cast</*SFINAE_TYPE to workaround clang bug*/SFINAE_TYPE(base_)>(*this)))
)
};
}
using append_no_adl::appender_type;
namespace appender_default {
template<typename Cont>
constexpr auto appender_impl(Cont& cont) noexcept {
return tc::appender_type<Cont>(cont);
}
}
DEFINE_TMPL_FUNC_WITH_CUSTOMIZATIONS(appender)
template<typename Cont>
using appender_t = decltype(tc::appender(std::declval<Cont>()));
template<typename Rng, typename Cont>
concept appendable = tc::has_for_each<Rng, tc::appender_t<Cont>>;
// Disallow 0 == sizeof...(Rng), so that overload taking single argument tc::tuple<Cont, Rng...> is rejected
template< typename RangeReturn = tc::return_void, typename Cont, tc::appendable<Cont&> Rng>
constexpr decltype(auto) append(Cont&& cont, Rng&& rng) MAYTHROW {
static_assert( !std::is_const<Cont>::value, "Cannot append to const container" );
static_assert( !tc::range_with_iterators<Cont> || std::is_lvalue_reference<Cont>::value, "Append to rvalue intentional?" );
if constexpr( !tc::range_with_iterators<Cont> || (
std::is_same<RangeReturn, tc::return_void>::value &&
noexcept(tc::for_each(tc_move_if_owned(rng), tc::appender(cont)))
) ) {
static_assert( std::is_same<RangeReturn, tc::return_void>::value, "RangeReturn not supported, if appending to stream." );
tc::for_each(tc_move_if_owned(rng), tc::appender(cont));
} else if constexpr( tc::random_access_range<Cont> || has_mem_fn_reserve<Cont> ) {
auto const nOffset = tc::size_raw(cont);
try {
tc::for_each(tc_move_if_owned(rng), tc::appender(cont));
if constexpr( !std::is_same<RangeReturn, tc::return_void>::value ) {
return RangeReturn::pack_border(
tc::begin_next<tc::return_border>(cont, nOffset),
cont
);
}
} catch (...) {
tc::take_first_inplace(cont, nOffset);
throw;
}
} else {
// assume iterators are stable to get iterator to first inserted element
auto const it = tc::back<tc::return_element_or_null>(cont);
auto const FirstAppendedElement = [&]() noexcept {
return it ? tc_modified(it, ++_) : tc::begin(cont);
};
try {
tc::for_each(tc_move_if_owned(rng), tc::appender(cont)); // MAYTHROW
if constexpr( !std::is_same<RangeReturn, tc::return_void>::value ) {
return RangeReturn::pack_border(FirstAppendedElement(), cont);
}
} catch (...) {
tc::take_inplace(cont, FirstAppendedElement());
throw;
}
}
}
template< typename RangeReturn = tc::return_void, typename Cont, tc::appendable<Cont&>... Rng> requires (1 < sizeof...(Rng))
constexpr decltype(auto) append(Cont&& cont, Rng&&... rng) MAYTHROW {
return tc::append<RangeReturn>(tc_move_if_owned(cont), tc::concat(tc_move_if_owned(rng)...));
}
namespace no_adl {
template<typename Cont, typename Rng>
struct append_on_dtor_t final : tc::noncopyable, tc::inside_unwinding {
tc::optional<Cont&> m_ocont;
tc::reference_or_value<Rng> m_rng;
append_on_dtor_t(Cont& cont, Rng&& rng) noexcept
: m_ocont(cont), m_rng(tc::aggregate_tag, tc_move_if_owned(rng))
{}
append_on_dtor_t(append_on_dtor_t&& other) noexcept
: m_ocont(tc_move(other).m_ocont), m_rng(tc_move(other).m_rng)
{
other.m_ocont = std::nullopt;
}
ASSIGN_BY_RENEW(append_on_dtor_t, append_on_dtor_t&&);
~append_on_dtor_t() MAYTHROW {
if(m_ocont && !inside_stack_unwinding()) {
tc::append(*m_ocont, *tc_move(m_rng)); // MAYTHROW
}
}
};
}
template<typename Cont, tc::appendable<Cont&> Rng>
constexpr decltype(auto) make_append_on_dtor(Cont& cont, Rng&& rng) MAYTHROW {
return no_adl::append_on_dtor_t<Cont, Rng>(cont, tc_move_if_owned(rng));
}
namespace explicit_convert_to_container_detail {
template<typename TTarget, typename Rng0, typename... RngN>
using use_ctor=tc::constant<
tc::derived_from<std::remove_cvref_t<Rng0>, TTarget> &&
(
0==sizeof...(RngN) ||
(!std::is_reference<Rng0>::value && !std::is_const<Rng0>::value)
)
>;
}
namespace explicit_convert_adl {
template<typename Cont>
concept appendable_container = has_mem_fn_push_back<Cont> || has_emplace_back<Cont, tc::range_value_t<Cont>>::value;
template<appendable_container TTarget, typename Rng0, tc::appendable<TTarget&>... RngN>
requires explicit_convert_to_container_detail::use_ctor<TTarget, Rng0, RngN...>::value
constexpr TTarget explicit_convert_impl(adl_tag_t, std::type_identity<TTarget>, Rng0&& rng0, RngN&&... rngN) MAYTHROW {
if constexpr(0<sizeof...(RngN)) {
TTarget cont=tc_move_if_owned(rng0);
tc::append(cont, tc_move_if_owned(rngN)...);
return cont;
} else {
return tc_move_if_owned(rng0);
}
}
template<appendable_container TTarget, tc::appendable<TTarget&> Rng0, tc::appendable<TTarget&>... RngN>
requires (!explicit_convert_to_container_detail::use_ctor<TTarget, Rng0, RngN...>::value)
constexpr TTarget explicit_convert_impl(adl_tag_t, std::type_identity<TTarget>, Rng0&& rng0, RngN&&... rngN) MAYTHROW {
TTarget cont;
tc::append(cont, tc_move_if_owned(rng0), tc_move_if_owned(rngN)...);
return cont;
}
}
template< typename... Rng >
[[nodiscard]] auto make_vector(Rng&&... rng) MAYTHROW {
static_assert(0 < sizeof...(Rng));
return tc::explicit_cast<tc::vector<tc::range_value_t<decltype(tc::concat(tc_move_if_owned(rng)...))>>>(tc_move_if_owned(rng)...);
}
template< typename Char, typename... Rng >
[[nodiscard]] auto make_str(Rng&&... rng) MAYTHROW {
static_assert(0 < sizeof...(Rng));
return tc::explicit_cast<tc::string<Char>>(tc_move_if_owned(rng)...);
}
template< typename... Rng >
[[nodiscard]] auto make_str(Rng&&... rng) MAYTHROW {
static_assert(0 < sizeof...(Rng));
return tc::make_str<tc::range_value_t<decltype(tc::concat(tc_move_if_owned(rng)...))>>(tc_move_if_owned(rng)...);
}
template< typename T, typename Rng >
[[nodiscard]] auto make_unique_unordered_set(Rng&& rng) MAYTHROW {
tc::unordered_set<T> set;
tc::cont_try_insert_range(set, tc_move_if_owned(rng));
return set;
}
template< typename Rng >
[[nodiscard]] auto make_unique_unordered_set(Rng&& rng) MAYTHROW {
return make_unique_unordered_set<tc::range_value_t<Rng>>(tc_move_if_owned(rng));
}
template< typename T, typename Rng >
[[nodiscard]] auto make_unordered_set(Rng&& rng) MAYTHROW {
tc::unordered_set<T> set;
tc::cont_must_insert_range(set, tc_move_if_owned(rng));
return set;
}
template< typename Rng >
[[nodiscard]] auto make_unordered_set(Rng&& rng) MAYTHROW {
return make_unordered_set<tc::range_value_t<Rng>>(tc_move_if_owned(rng));
}
}
================================================
FILE: tc/algorithm/append.t.cpp
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#include "../base/assert_defs.h"
#include "append.h"
#include "../unittest.h"
#include "../string/format.h"
#include "../static_vector.h"
#include "../range/filter_adaptor.h"
static_assert(tc::appendable<char const*, tc::string<char>&>);
static_assert(!tc::appendable<int, tc::string<char>&>);
static_assert(tc::appendable<tc::char16 const*, tc::string<char>&>);
static_assert(tc::appendable<decltype(tc::as_dec(5)), tc::string<char>&>);
static_assert(!tc::appendable<tc::size_proxy<int>, tc::string<char>&>);
static_assert(!tc::appendable<tc::vector<int>, tc::string<char>&>);
static_assert(!tc::appendable<tc::static_vector<int, 3>, tc::string<char>&>);
UNITTESTDEF(nonappendable) {
tc::vector<int> vecnTest{1, 2, 3};
auto rngTest1=tc::transform(vecnTest, [](auto const n) noexcept { return n + 1; });
static_assert(!tc::appendable<decltype(rngTest1), tc::string<char>&>);
auto rngTest2=tc::filter(vecnTest, [](auto const n) noexcept { return n%2==1; });
static_assert(!tc::appendable<decltype(rngTest2), tc::string<char>&>);
}
UNITTESTDEF(append_on_dtor) {
{
tc::string<char> str;
tc::append(str, "Hello ");
{
tc::make_append_on_dtor(str, "World!");
}
_ASSERT(tc::equal(str, "Hello World!"));
}
{
tc::string<char> str;
{
tc_auto_cref(a1, tc::make_append_on_dtor(str, "World!"));
tc_auto_cref(a2, tc::make_append_on_dtor(str, "Hello "));
}
_ASSERT(tc::equal(str, "Hello World!"));
}
}
================================================
FILE: tc/algorithm/best_element.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../range/subrange.h"
#include "../storage_for.h"
#include "../base/change.h"
#include "accumulate.h"
#include "compare.h"
namespace tc {
template< typename RangeReturn, typename Better, typename Rng>
[[nodiscard]] constexpr decltype(auto) best_element_impl(Better better, Rng&& rng) MAYTHROW {
if constexpr( RangeReturn::requires_iterator ) {
auto const itEnd=tc::end(rng); // MAYTHROW
decltype(tc::begin(rng)) ait[2]={ tc::begin(rng) }; // MAYTHROW
if(ait[0]==itEnd) {
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
} else {
tc::storage_for< tc::reference_or_value<decltype(*ait[0])> > aoref[2];
aoref[0].ctor( aggregate_tag, *ait[0] ); // MAYTHROW
for(;;){
for( int i=0; i!=2; ++i ) { // we expect the compiler to unroll this loop
// aoref[i] is constructed, aoref[1-i] is not constructed
tc_scope_exit { aoref[i].dtor(); }; // also required in case of exception
ait[1-i]=ait[i];
for(;;) {
// aoref[i] is constructed, aoref[1-i] is not constructed
++ait[1-i];
if(ait[1-i]==itEnd) {
return RangeReturn::pack_element(tc_move_always(ait[i]),tc_move_if_owned(rng),**tc_move_always(aoref[i]));
}
aoref[1-i].ctor( aggregate_tag, *ait[1-i] ); // MAYTHROW
try {
if( tc_invoke(better, tc::as_const(**aoref[1-i]), tc::as_const(**aoref[i])) ) { // MAYTHROW
break; // only path where aoref[1-i] is not destroyed
}
} catch(...) {
aoref[1-i].dtor();
throw;
}
aoref[1-i].dtor();
}
}
}
}
} else if (auto ovalue = tc::accumulate_with_front(tc_move_if_owned(rng), [&](auto& valueBest, auto&& value) noexcept {
return tc::assign_better(better, valueBest, tc_move_if_owned(value));
})) {
return RangeReturn::template pack_element<Rng>(*tc_move(ovalue));
} else {
return RangeReturn::template pack_no_element<Rng>();
}
}
template< typename RangeReturn, typename Better, typename Rng, typename Projection = tc::identity>
[[nodiscard]] constexpr decltype(auto) best_element(Better&& better, Rng&& rng, Projection&& projection = Projection()) MAYTHROW {
return tc::best_element_impl<RangeReturn>(tc::projected(tc_move_if_owned(better), tc_move_if_owned(projection)), tc_move_if_owned(rng));
}
template< typename RangeReturn, typename Rng, typename Projection = tc::identity >
[[nodiscard]] constexpr decltype(auto) min_element(Rng&& rng, Projection&& projection = Projection()) MAYTHROW {
return tc::best_element<RangeReturn>(tc::fn_less(), tc_move_if_owned(rng), tc_move_if_owned(projection));
}
template< typename RangeReturn, typename Rng, typename Projection = tc::identity >
[[nodiscard]] constexpr decltype(auto) max_element(Rng&& rng, Projection&& projection = Projection()) MAYTHROW {
return tc::best_element<RangeReturn>(tc::fn_greater(), tc_move_if_owned(rng), tc_move_if_owned(projection));
}
template< typename RangeReturn, typename Rng, typename T >
[[nodiscard]] constexpr decltype(auto) closest_element(Rng&& rng, T const& t) MAYTHROW {
return tc::min_element<RangeReturn>(tc_move_if_owned(rng), [&](auto const& elem) MAYTHROW { return std::abs(t - elem); });
}
}
================================================
FILE: tc/algorithm/binary_operators.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../base/derivable.h"
#include "../base/generic_macros.h"
#include "../base/modified.h"
#include "../base/empty_chain.h"
#include "round.h"
#ifdef MSVC_WORKAROUND
#include <boost/preprocessor/punctuation/comma.hpp>
#include <boost/preprocessor/punctuation/paren.hpp>
#endif
namespace tc {
#pragma push_macro("GENERIC_OP_BODY")
#define GENERIC_OP_BODY(op, operation_body) \
template< typename Lhs, typename Rhs \
> \
requires is_operation_available<Lhs&&, Rhs&&> \
[[nodiscard]] friend constexpr auto operator op(Lhs&& lhs, Rhs&& rhs) noexcept { \
static_assert(tc::decayed<conversion_t<Lhs, Rhs>>); \
using Result = std::conditional_t<std::is_same<conversion_t<Lhs, Rhs>, Lhs>::value, Lhs&&, conversion_t<Lhs, Rhs>>; \
Result _ = tc_move_if_owned(lhs); \
operation_body; \
if constexpr( std::is_same<Result, Lhs&&>::value ) { \
return tc_move_if_owned(_); \
} else { \
static_assert( \
std::is_same<Result, tc::decay_t<Lhs>>::value \
|| !is_compound_available<tc::decay_t<Lhs>, Rhs&&>, \
"conversion_t provides a conversion, despite " #op "= being offered by the original type" \
); \
return _; \
} \
}
#pragma push_macro("DEFINE_GENERIC_OP")
#define DEFINE_GENERIC_OP(name, op) \
namespace binary_operator_conversions { \
template< typename Lhs, typename Rhs > \
struct name##_conversion_type { \
using type = Lhs; \
}; \
template< typename Lhs, typename Rhs> \
struct internal_##name##_conversion_type : name##_conversion_type<Lhs, Rhs> { }; \
} \
namespace generic_operator_helper { \
/*Checks if (TThis&& op##= TOther&&) is defined*/ \
TC_HAS_EXPR(compound_##name, (TThis)(TOther), std::declval<TThis>() op##= std::declval<TOther>()); \
/*Checks if (TThis&&.operator op##=(TOther&&)) is defined*/ \
TC_HAS_EXPR(mem_fn_compound_##name, (TThis)(TOther), std::declval<TThis>().operator op##=(std::declval<TOther>())); \
} \
namespace no_adl { \
template< typename Base = void > \
struct TC_EMPTY_BASES name : std::conditional_t<std::is_void<Base>::value, tc::empty_chain<name<void>>, Base> { \
private: \
template< typename Lhs, typename Rhs > \
static constexpr bool is_compound_available = tc::generic_operator_helper::has_mem_fn_compound_ ##name<Lhs&, Rhs>; \
template< typename Lhs, typename Rhs > \
using conversion_t = typename binary_operator_conversions::internal_##name##_conversion_type<tc::decay_t<Lhs>, tc::decay_t<Rhs>>::type; \
/*If we're not forwarding an rvalue, we're calling the operator on the result of tc::decay_copy(Lhs&), which is tc::decay_t<Lhs>& \
If we're forwarding an rvalue, we're calling the operator on remove_reference_t<Lhs>&. But is_same<tc::decay_t<Lhs>, remove_reference_t<Lhs>>::value. */ \
template< typename Lhs, typename Rhs > \
static constexpr auto is_operation_available = \
tc::derived_from<conversion_t<Lhs, Rhs>, name> \
&& is_compound_available<conversion_t<Lhs, Rhs>, Rhs>; \
public: \
GENERIC_OP_BODY( op, _.operator op##=(tc_move_if_owned(rhs)) ); \
}; \
\
template< typename Other, typename Base = void > \
struct TC_EMPTY_BASES external_ ##name : std::conditional_t<std::is_void<Base>::value, tc::empty_chain<external_ ##name <void>>, Base> { \
private: \
template< typename Lhs, typename Rhs > \
static constexpr bool is_compound_available = tc::generic_operator_helper::has_compound_ ##name<Lhs&, Rhs>; \
template< typename Lhs, typename Rhs > \
using conversion_t = tc::decay_t<Lhs>; \
static_assert( std::is_fundamental<Other>::value, "external_" #name " is only meant for fundamental types" ); \
STATICASSERTSAME( tc::decay_t<Other>, Other ); \
template< typename Lhs, typename Rhs > \
static constexpr auto is_operation_available = \
tc::derived_from<std::remove_reference_t<Lhs>, Other> \
&& tc::derived_from<std::remove_reference_t<Rhs>, external_ ##name<Other, Base>> \
/* Same reasoning as in the internal operator */ \
&& is_compound_available<tc::decay_t<Lhs>, Rhs>; \
public: \
GENERIC_OP_BODY( op, { \
static_assert(!tc::generic_operator_helper::has_mem_fn_compound_ ##name<decltype((_)), decltype(tc_move_if_owned(rhs))>); \
_ op##= tc_move_if_owned(rhs); \
} ); \
}; \
} \
using no_adl::name; \
using no_adl::external_ ##name; \
// By default, tc::addable &co. allow operations for which there exists a corresponding lhs.operator op=(rhs) member operator
// For cases where the left-hand side requires a promoting conversion before the operation can take place,
// specialize one of the tc::binary_operator_conversions::*_conversion_type structs
// Example: if class A wants A+B to be performed by converting A to C:
// 1. both A and C need to derive from tc::addable (C needs it to satisfy SFINAE sanity checks, A needs it so that ADL can find the generic operator+)
// Note: A wouldn't need to derive from addable, if the generic operators were global, but that would increase the complexity of compiling any operator call
// 2. C.operator+=(B) (with appropriate cvref qualifiers) must exist and be accessible
// 3. there must be a specialization for tc::binary_operator_conversions::addable_conversion_type<A, B> that defines the alias type=C;
DEFINE_GENERIC_OP(addable, +);
DEFINE_GENERIC_OP(subtractable, -);
DEFINE_GENERIC_OP(multipliable, *);
DEFINE_GENERIC_OP(dividable, /);
DEFINE_GENERIC_OP(orable, |);
DEFINE_GENERIC_OP(andable, &);
DEFINE_GENERIC_OP(xorable, ^);
DEFINE_GENERIC_OP(left_shiftable, <<);
#pragma pop_macro("DEFINE_GENERIC_OP")
#pragma pop_macro("GENERIC_OP_BODY")
template< typename Base = void >
using additive = addable<subtractable<Base>>;
template< typename Base = void >
using multiplicative = multipliable<dividable<Base>>;
template< typename Base = void >
using arithmetic = additive<multiplicative<Base>>;
template< typename Base = void >
using setlike = andable<orable<xorable<subtractable<Base>>>>;
template< typename Other, typename Base = void >
using external_additive = external_addable<Other, external_subtractable<Other, Base>>;
template< typename Other, typename Base = void >
using external_multiplicative = external_multipliable<Other, external_dividable<Other, Base>>;
template< typename Other, typename Base = void >
using external_arithmetic = external_additive<Other, external_multiplicative<Other, Base>>;
// If the same conversion logic applies to multiple operations, you can specialize one of the grouped conversions defined here
namespace binary_operator_conversions {
#pragma push_macro("PROXY_CONVERSION")
#define PROXY_CONVERSION(nameFrom, nameTo) \
template< typename Lhs, typename Rhs > \
requires requires { typename nameTo##_conversion_type<Lhs, Rhs>::type; } \
struct internal_##nameFrom##_conversion_type<Lhs, Rhs> \
: nameTo##_conversion_type<Lhs, Rhs> \
{}
template< typename Lhs, typename Rhs >
struct additive_conversion_type { };
PROXY_CONVERSION(addable, additive);
PROXY_CONVERSION(subtractable, additive);
template< typename Lhs, typename Rhs >
struct multiplicative_conversion_type { };
PROXY_CONVERSION(multipliable, multiplicative);
PROXY_CONVERSION(dividable, multiplicative);
template< typename Lhs, typename Rhs >
struct arithmetic_conversion_type { };
PROXY_CONVERSION(addable, arithmetic);
PROXY_CONVERSION(subtractable, arithmetic);
PROXY_CONVERSION(multipliable, arithmetic);
PROXY_CONVERSION(dividable, arithmetic);
template< typename Lhs, typename Rhs >
struct setlike_conversion_type { };
PROXY_CONVERSION(andable, setlike);
PROXY_CONVERSION(orable, setlike);
PROXY_CONVERSION(xorable, setlike);
PROXY_CONVERSION(subtractable, setlike);
#pragma pop_macro("PROXY_CONVERSION")
}
namespace scalar_binary_op_detail::no_adl {
template<typename FnOp, typename Rhs>
struct func {
Rhs const& m_rhs;
template <typename LhsElement>
constexpr auto operator()(LhsElement&& lhselem) const& return_decltype_allow_xvalue_MAYTHROW( // should be NOEXCEPT, but NOEXCEPT does not allow xvalues.
tc_invoke(FnOp(), tc_move_if_owned(lhselem), m_rhs)
)
};
struct no_prepost_scalar_operation {
static constexpr void pre(tc::unused /*scalar*/) noexcept {}
static constexpr void post(tc::unused /*lhs*/, tc::unused /*scalar*/) noexcept {}
};
template<typename Pred>
struct assert_zero_to_scalar_relation final : no_prepost_scalar_operation {
template<typename Scalar>
static constexpr void pre(Scalar const& scalar) noexcept {
_ASSERTE( Pred()(tc::explicit_cast<Scalar>(0), scalar) );
}
};
}
using scalar_binary_op_detail::no_adl::no_prepost_scalar_operation;
using assert_non_zero_scalar = scalar_binary_op_detail::no_adl::assert_zero_to_scalar_relation<fn_not_equal_to>;
using assert_non_negative_scalar = scalar_binary_op_detail::no_adl::assert_zero_to_scalar_relation<fn_less_equal>;
using assert_positive_scalar = scalar_binary_op_detail::no_adl::assert_zero_to_scalar_relation<fn_less>;
#pragma push_macro("DEFINE_SCALAR_OP")
#define DEFINE_SCALAR_OP(name, op, fnop, fnassignop, prepostopdefault) \
namespace no_adl { \
template<typename Base = void, std::size_t nTransformDepth = 0, typename PrePostOperation = prepostopdefault> \
struct TC_EMPTY_BASES scalar_ ## name : std::conditional_t<std::is_void<Base>::value, tc::empty_chain<scalar_ ## name<void, nTransformDepth, PrePostOperation>>, Base> { \
template<tc::decayed_derived_from<scalar_ ## name> Lhs, typename Rhs \
IF_MSVC_WORKAROUND_ELSE( \
TC_FWD(BOOST_PP_COMMA() typename=decltype BOOST_PP_LPAREN()), /* workaround VS17.8 compiler bug: https://developercommunity.visualstudio.com/t/template-member-function-is-not-recogniz/10504199 */ \
TC_FWD(> requires requires {) \
) \
std::declval<Lhs>().template transform<nTransformDepth>(std::declval<scalar_binary_op_detail::no_adl::func<fnop, Rhs>>())IF_NO_MSVC_WORKAROUND(;) \
IF_MSVC_WORKAROUND_ELSE( \
BOOST_PP_RPAREN()>, \
} \
) \
[[nodiscard]] friend constexpr decltype(auto) operator op(Lhs&& lhs, Rhs const& rhs) noexcept { \
PrePostOperation::pre(rhs); \
decltype(auto) _ = tc_move_if_owned(lhs).template transform<nTransformDepth>(scalar_binary_op_detail::no_adl::func<fnop, Rhs>{rhs}); \
PrePostOperation::post(_, rhs); \
return _; \
} \
\
template<tc::decayed_derived_from<scalar_ ## name> Lhs, typename Rhs> requires requires { \
tc::for_each(std::declval<Lhs&>(), std::declval<scalar_binary_op_detail::no_adl::func<fnassignop, Rhs>>()); \
} \
friend constexpr Lhs& operator op ## =(Lhs& lhs, Rhs const& rhs) noexcept { \
PrePostOperation::pre(rhs); \
tc::for_each(lhs, scalar_binary_op_detail::no_adl::func<fnassignop, Rhs>{rhs}); \
PrePostOperation::post(lhs, rhs); \
return lhs; \
} \
}; \
} \
using no_adl::scalar_ ## name;
DEFINE_SCALAR_OP(addable, +, tc::fn_plus, tc::fn_assign_plus, tc::no_prepost_scalar_operation)
DEFINE_SCALAR_OP(subtractable, -, tc::fn_minus, tc::fn_assign_minus, tc::no_prepost_scalar_operation)
DEFINE_SCALAR_OP(multipliable, *, tc::fn_mul, tc::fn_assign_mul, tc::no_prepost_scalar_operation)
DEFINE_SCALAR_OP(dividable, /, tc::fn_div, tc::fn_assign_div, tc::assert_non_zero_scalar)
#pragma pop_macro("DEFINE_SCALAR_OP")
namespace no_adl {
template<typename Base = void, std::size_t nTransformDepth = 0>
using scalar_multiplicative = tc::scalar_multipliable<tc::scalar_dividable<Base, nTransformDepth>, nTransformDepth>;
}
using no_adl::scalar_multiplicative;
}
================================================
FILE: tc/algorithm/break_or_continue.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../base/assert_defs.h"
#include "../base/enum.h"
#include "../base/noncopyable.h"
#include "../base/derivable.h"
#include <type_traits>
#include <functional>
namespace tc {
TC_DEFINE_ENUM(break_or_continue, BOOST_PP_EMPTY(), (break_)(continue_))
[[nodiscard]] inline constexpr tc::break_or_continue continue_if(tc::bool_context bCondition) noexcept {
if( bCondition ) {
return tc::continue_;
} else {
return tc::break_;
}
}
#define tc_return_if_break_impl(sometimes_break_value, ...) \
{ \
auto boc__ = (__VA_ARGS__); \
/* Inline constexpr bools as soon as "constexpr if" works properly in MSVC */ \
MODIFY_WARNINGS_BEGIN(((disable)(4189))) /* diable warning C4189 to workaround VS2022 17.0 compiler bug: https://developercommunity.visualstudio.com/t/unexpected-warning-c4189-with-vs170-preview-21/1489426 */ \
constexpr bool bAlwaysBreaks = std::is_same<decltype(boc__), tc::constant<tc::break_>>::value; \
constexpr bool bNeverBreaks = std::is_same<decltype(boc__), tc::constant<tc::continue_>>::value; \
MODIFY_WARNINGS_END \
if constexpr (bAlwaysBreaks) { \
return tc::constant<tc::break_>(); \
} \
else if constexpr (!bNeverBreaks) { \
if( tc::break_ == boc__ ) { \
return sometimes_break_value; \
} \
} \
}
#define tc_return_if_break(...) \
tc_return_if_break_impl(tc::break_, __VA_ARGS__)
namespace continue_if_not_break_adl {
template<typename BreakOrContinueDefault = tc::constant<tc::continue_>>
struct impl_t final {
BreakOrContinueDefault m_boc;
};
inline constexpr impl_t<> impl = {tc::constant<tc::continue_>()};
template<typename BreakOrContinue>
using is_break_or_continue = boost::mp11::mp_set_contains<boost::mp11::mp_list<tc::break_or_continue, tc::constant<tc::break_>, tc::constant<tc::continue_>>, BreakOrContinue>;
template<typename BreakOrContinue> requires is_break_or_continue<BreakOrContinue>::value
constexpr impl_t<BreakOrContinue> operator,(BreakOrContinue boc, impl_t<> const&) noexcept {
return {boc};
}
// The built-in "operator," would be fine, but this is needed to protect against other libraries that overload "operator," (e.g. boost::proto).
template<typename NotBreakOrContinue> requires (!is_break_or_continue<std::remove_cvref_t<NotBreakOrContinue>>::value)
constexpr impl_t<> const& operator,(NotBreakOrContinue&& /*notboc*/, impl_t<> const& _) noexcept {
return _;
}
// Built-in:
//template<typename >
//impl_t<> const& operator,(void, impl_t<> const& _) noexcept {
// return _;
//}
#define tc_internal_continue_if_not_break(...) tc::decay_copy(((__VA_ARGS__), tc::continue_if_not_break_adl::impl).m_boc)
}
template<typename Void> requires std::is_void<Void>::value
constexpr Void implicit_cast(tc::constant<tc::continue_>) noexcept {}
//////////////////////////////////////////////////////////////////////////
//// continue_if_not_break ///////////////////////////////////////////////////////////////////////////
// Func returns break_or_continue
template <typename Sink, typename ... Args>
concept sinkable = tc::invocable<std::remove_cvref_t<Sink> const&, Args...>;
template <typename Sink, typename ... Args>
concept nothrow_sinkable = tc::sinkable<Sink, Args...> && tc::nothrow_invocable<std::remove_cvref_t<Sink> const&, Args...>;
template<typename Sink, typename... Args>
constexpr auto continue_if_not_break(Sink const& sink, Args&&... args) return_decltype_MAYTHROW(
tc_internal_continue_if_not_break(tc_invoke_pack(sink, tc_move_if_owned(args)))
)
namespace no_adl {
///////////////////////////////////////////////////
// tc::move_only_function
// Supports constructing tc::move_only_function<tc::break_or_continue_(...)> from a callable with return type other than break_or_continue_.
// TODO: Implement on top of std::move_only_function once it becomes available
template<typename Func> requires (!std::is_final_v<tc::decay_t<Func>>) && std::move_constructible<tc::decay_t<Func>>
struct movable_functor_adaptor_base : tc::derivable_t<tc::decay_t<Func>> {
private:
using base_t = tc::derivable_t<tc::decay_t<Func>>;
public:
movable_functor_adaptor_base(Func&& func) noexcept requires tc::safely_constructible_from<base_t, Func&&>
: base_t(tc_move_if_owned(func)) {}
movable_functor_adaptor_base(movable_functor_adaptor_base&&) = default; // not noexcept to "inherit" exception-specifier from base class
movable_functor_adaptor_base(movable_functor_adaptor_base const& mfa) noexcept
: base_t(tc_move_always(tc::as_mutable(tc::base_cast<base_t>(mfa))))
{
// On the Mac, the std::function move ctor may actually copy our movable_functor_adaptor.
// Since tc::move_only_function is noncopyable, we always move here.
}
};
template<typename /*Ret*/, typename Func> requires requires { typename movable_functor_adaptor_base<Func>; }
struct movable_functor_adaptor final : movable_functor_adaptor_base<Func> {
using movable_functor_adaptor_base<Func>::movable_functor_adaptor_base;
// no return_decltype_..._MAYTHROW: type is still incomplete in function signature - tc::base_cast does not compile on clang
template<typename... Args> requires requires { std::declval<tc::decay_t<Func>&>()(std::declval<Args>()...); }
decltype(auto) operator()(Args&& ... args) & noexcept(noexcept(std::declval<tc::decay_t<Func>&>()(std::declval<Args>()...))) {
return tc::base_cast<tc::decay_t<Func>>(*this)(tc_move_if_owned(args)...);
}
// no return_decltype_..._MAYTHROW: type is still incomplete in function signature - tc::base_cast does not compile on clang
template<typename... Args> requires requires { std::declval<tc::decay_t<Func> const&>()(std::declval<Args>()...); }
decltype(auto) operator()(Args&& ... args) const& noexcept(noexcept(std::declval<tc::decay_t<Func> const&>()(std::declval<Args>()...))) {
return tc::base_cast<tc::decay_t<Func>>(*this)(tc_move_if_owned(args)...);
}
};
template<typename Func> requires requires { typename movable_functor_adaptor_base<Func>; }
struct movable_functor_adaptor<tc::break_or_continue, Func> final : movable_functor_adaptor_base<Func> {
using movable_functor_adaptor_base<Func>::movable_functor_adaptor_base;
// no return_decltype_..._MAYTHROW: type is still incomplete in function signature - tc::base_cast does not compile on clang
template<typename... Args> requires requires { tc::continue_if_not_break(std::declval<tc::decay_t<Func>&>(), std::declval<Args>()...); }
tc::break_or_continue operator()(Args&& ... args) & noexcept(noexcept(
tc::continue_if_not_break(std::declval<tc::decay_t<Func>&>(), std::declval<Args>()...)
)) {
return tc::continue_if_not_break(tc::base_cast<tc::decay_t<Func>>(*this), tc_move_if_owned(args)...);
}
// no return_decltype_..._MAYTHROW: type is still incomplete in function signature - tc::base_cast does not compile on clang
template<typename... Args> requires requires { tc::continue_if_not_break(std::declval<tc::decay_t<Func> const&>(), std::declval<Args>()...); }
tc::break_or_continue operator()(Args&& ... args) const& noexcept(noexcept(
tc::continue_if_not_break(std::declval<tc::decay_t<Func> const&>(), std::declval<Args>()...)
)) {
return tc::continue_if_not_break(tc::base_cast<tc::decay_t<Func>>(*this), tc_move_if_owned(args)...);
}
};
template< bool bNoExcept, typename Ret, typename... Args >
struct move_only_function_base: tc::noncopyable {
private:
std::function< Ret(Args...) > m_func;
public:
move_only_function_base() noexcept {} // creates an empty function
move_only_function_base(std::nullptr_t) noexcept {} // creates an empty function
move_only_function_base(move_only_function_base&& func) noexcept : m_func(tc_move(func).m_func) {}
move_only_function_base& operator=(move_only_function_base&& func) noexcept {
m_func=tc_move(func).m_func;
return *this;
}
template< typename Func > requires
(!tc::decayed_derived_from<Func, move_only_function_base>) &&
tc::safely_constructible_from<movable_functor_adaptor<Ret, Func>, Func&&> &&
tc::safely_constructible_from<decltype(m_func), movable_functor_adaptor<Ret, Func>>
move_only_function_base(Func&& func) noexcept
: m_func(movable_functor_adaptor<Ret, Func>(tc_move_if_owned(func)))
{
static_assert(!tc::decayed_derived_from<Func, std::function< Ret(Args...) >>);
// TODO: static_assert(!tc::decayed_derived_from<Func, std::move_only_function< Ret(Args...) >>);
// Checking the noexcept value of the function call is commented out because
// 1. std::ref(func)'s operator() is not noexcept
// 2. tc::unordered_set's move ctor is not noexcept
// 3. boost::bind overloaded operators are not noexcept
//static_assert(!bNoExcept || noexcept(std::declval<tc::decay_t<Func>&>()(std::declval<Args>()...)));
}
explicit operator bool() const& noexcept { tc_return_cast(m_func); }
Ret operator()(Args ... args) const& noexcept(bNoExcept) {
return m_func(tc_move_if_owned(args)...);
}
friend decltype(auto) debug_output_impl(move_only_function_base const& self) noexcept {
return self.m_func.target_type().name();
}
};
template< typename Signature >
struct move_only_function;
template< typename Ret, typename... Args >
struct move_only_function< Ret(Args...) > : tc::no_adl::move_only_function_base</*bNoExcept*/false, Ret, Args...>
{
using base_ = typename move_only_function::move_only_function_base;
using base_::base_;
};
template< typename Ret, typename... Args >
struct move_only_function< Ret(Args...) noexcept > : tc::no_adl::move_only_function_base</*bNoExcept*/true, Ret, Args...>
{
using base_ = typename move_only_function::move_only_function_base;
using base_::base_;
};
} // no_adl
using no_adl::move_only_function;
inline bool cyclic_improve_impl(int const n, int& nSkipRule) noexcept {
return false;
}
template<typename F0, typename... F>
bool cyclic_improve_impl(int n, int& nSkipRule, F0& f0, F&... f) {
if (n != nSkipRule && f0()) {
nSkipRule = n;
return true;
} else {
return cyclic_improve_impl(n+1, nSkipRule, f...);
}
}
template< typename... F >
bool cyclic_improve(F... f) noexcept {
int nSkipRule=-1;
while(cyclic_improve_impl(0, nSkipRule, f...)) {}
return -1 != nSkipRule;
}
}
================================================
FILE: tc/algorithm/compare.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../base/return_decltype.h"
#include "../base/chained.h"
#include "../base/enum.h"
#include "../base/functors.h"
#include "../base/inplace.h"
#include "../base/template_func.h"
#include "../base/empty_chain.h"
#include "../range/transform_adaptor.h"
#include "../base/change.h"
#include "find.h"
#include "../interval_types.h"
#if defined(__clang__) && !defined(__cpp_lib_three_way_comparison) // three way comparison operators are not implemented for library types in Xcode13/14. TODO Xcode15
#include "../optional.h"
#include "../variant.h"
#endif
#include <boost/preprocessor/variadic/to_seq.hpp>
#include <compare>
#include <concepts>
namespace tc {
// < involving NAN always returns false, so it is not even a partial order
template<typename T>
constexpr void assert_not_isnan(T const& t) noexcept {
if constexpr( std::floating_point<T> ) {
_ASSERTDEBUG( !std::isnan(t) );
}
}
}
namespace tc {
// we always use tc::compare to perform 3 way comparison and tc::compare tc::explicit_cast std::strong_ordering/partial_ordering result to std::weak_ordering
template<typename Cat>
concept is_comparison_category = std::same_as<Cat, std::weak_ordering>;
namespace no_adl {
// class T derives from tc::equal_from_three_way if T has a user defined operator<=> and implements operator== with operator<=>
template< typename T >
struct TC_EMPTY_BASES equal_from_three_way {
template<ENABLE_SFINAE> // ENABLE_SFINAE is needed because of possible clang/regression gcc bug https://godbolt.org/z/z7z3nf34f. It will be fixed in clang 16.
friend constexpr bool operator==(SFINAE_TYPE(T) const& lhs, SFINAE_TYPE(T) const& rhs) noexcept(noexcept(lhs<=>rhs==0)) requires requires { {lhs<=>rhs==0} -> std::same_as<bool>; } {
return lhs<=>rhs==0;
}
};
// Default primary comparison operators
// 1. operator== requires that each base class and member has associated operator==
// 2. operator<=>:
// 1) with auto return type: requires that each base class and member has associated operator<=>
// 2) with comparison category return type: requires that each base class and member has either associated operator<=>, or both operator== and operator<.
// Our chained empty base classes are not comparable by default. If we want to define primary comparison operators as default for some class with empty base(s),
// we need to wrap tc::comparable around the empty base chain to make the chain comparable.
template< typename EmptyBase=void >
struct TC_EMPTY_BASES comparable: std::conditional_t<std::is_void<EmptyBase>::value, tc::empty_chain<comparable<void>>, EmptyBase> {
static_assert(std::is_empty<std::conditional_t<std::is_void<EmptyBase>::value, tc::empty_chain<comparable<void>>, EmptyBase>>::value);
// tc::comparable offers primary operators only for itself, not for derived types. Therefore we cannot accidently compare 2 types derived from tc::comparable.
template<typename T> requires std::same_as<T, comparable>
friend constexpr bool operator==(T const&, T const&) noexcept { return true; }
template<typename T> requires std::same_as<T, comparable>
friend constexpr auto operator<=>(T const&, T const&) noexcept { return std::weak_ordering::equivalent; }
};
}
using no_adl::equal_from_three_way;
using no_adl::comparable;
namespace inplace_adl {
template<tc::is_comparison_category Cat>
constexpr auto operator-(inplace<Cat> inplaceorder) noexcept {
inplaceorder.m_t = 0<=>inplaceorder.m_t;
}
}
#ifndef __clang__
using std::is_eq;
using std::is_neq;
#else // Xcode14 doesn't have std::is_eq & std::is_neq while Xcode13 does.
constexpr bool is_eq(std::partial_ordering order) noexcept { return order==0; }
constexpr bool is_neq(std::partial_ordering order) noexcept { return order!=0; }
#endif
namespace explicit_convert_adl {
template<std::same_as<std::weak_ordering> TTarget, std::same_as<std::partial_ordering> TSource>
constexpr TTarget explicit_convert_impl(adl_tag_t, std::type_identity<TTarget>, TSource const& order) noexcept {
if(std::is_lt(order)) {
return std::weak_ordering::less;
} else if(tc::is_eq(order)) {
return std::weak_ordering::equivalent;
} else if(std::is_gt(order)) {
return std::weak_ordering::greater;
} else {
_ASSERTFALSE; // unordered is not supported
return std::weak_ordering::less;
}
}
}
// clang workaround
template<typename Lhs, typename Rhs>
concept has_operator_3way_compare = requires(Lhs const& lhs, Rhs const& rhs) { lhs<=>rhs; };
template<typename Lhs, typename Rhs>
constexpr std::weak_ordering compare(Lhs const& lhs, Rhs const& rhs) noexcept(noexcept(lhs<=>rhs)) requires has_operator_3way_compare<Lhs, Rhs> && (!tc::comparable_pointers<Lhs, Rhs>) {
// We tc::explicit_cast std::partial_ordering/std::strong_ordering result to std::weak_ordering.
// Comparisons that return std::partial_ordering:
// 1. floating point comparison
// 2. library types comparison may return std::partial_ordering if they contain floating point values. e.g. std::vector, std::pair, std::variant, std::tuple
tc_return_cast(lhs<=>rhs);
}
// similar to Synthesized three-way comparison except with tc::less instead of operator<
// 1. boost::multiprecision numbers don't support three-way comparison
// 2. clang library iterators don't support three-way comparison
// 3. pointers: std::compare_three_way doesn't support function pointer comparison and is not implemented in Xcode13/14
template<typename Lhs, typename Rhs>
constexpr std::weak_ordering compare(Lhs const& lhs, Rhs const& rhs) noexcept(noexcept(tc::less(lhs,rhs)) && noexcept(tc::less(rhs,lhs))) requires
(!has_operator_3way_compare<Lhs, Rhs> || tc::comparable_pointers<Lhs, Rhs>) &&
requires {
tc::less(lhs,rhs);
tc::less(rhs,lhs);
}
{
if(tc::less(lhs,rhs)) {
return std::weak_ordering::less;
} else if(tc::less(rhs, lhs)){
return std::weak_ordering::greater;
} else {
return std::weak_ordering::equivalent;
}
}
tc_define_fn(compare)
//////////////////////////////////////////////////////////////
// macros for implementing compare on compound types
#define tc_return_if_not_equal( compare ) \
if ( auto const order_ = compare; tc::is_neq(order_) ) return order_;
// auto&& triggers internal error for VS2017
// decltype((lhs)) triggers internal error for VS2019 16.8.0 preview 3.0
// Not using return_decltype_MAYTHROW because noexcept(noexcept(expr)) not needed and triggering ICE in MSVC 19.28.
#define tc_internal_compare_expr(fcompare, lhs, rhs, expr) \
(fcompare)( \
([&](auto&& _) MAYTHROW -> decltype(auto) { return tc::lvalue_or_decay(VERIFYINITIALIZED(expr)); })(VERIFYINITIALIZED(lhs)), \
([&](auto&& _) MAYTHROW -> decltype(auto) { return tc::lvalue_or_decay(VERIFYINITIALIZED(expr)); })(VERIFYINITIALIZED(rhs)) \
)
#define tc_compare_expr( expr ) tc_return_if_not_equal( tc_internal_compare_expr(tc::compare, lhs, rhs, expr) )
#define tc_compare_expr_reverse( expr ) tc_return_if_not_equal( tc_internal_compare_expr(tc::compare, rhs, lhs, expr) )
#define tc_compare_expr_reverse_if( cond, expr ) tc_return_if_not_equal( tc::negate_if(cond, tc_internal_compare_expr(tc::compare, lhs, rhs, expr)) )
#define tc_compare_expr_times_sign( expr, sign ) tc_return_if_not_equal( tc_internal_compare_expr(tc::compare, lhs, rhs, expr)*(sign) )
#define tc_compare_expr_lex( expr ) tc_return_if_not_equal( tc_internal_compare_expr(tc::lexicographical_compare_3way, lhs, rhs, expr) )
#define tc_compare_expr_lex_reverse( expr ) tc_return_if_not_equal( tc_internal_compare_expr(tc::lexicographical_compare_3way, rhs, lhs, expr) )
#define tc_compare_expr_lex_reverse_if( cond, expr ) tc_return_if_not_equal( tc::negate_if(cond, tc_internal_compare_expr(tc::lexicographical_compare_3way, lhs, rhs, expr)) )
#define tc_compare_expr_lex_times_sign( expr, sign ) tc_return_if_not_equal( tc_internal_compare_expr(tc::lexicographical_compare_3way, lhs, rhs, expr)*(sign) )
#define tc_compare_base( basetype ) \
tc_compare_expr( tc::base_cast<basetype>(_) );
#define tc_compare_mask( maskmember, maskvalue ) \
tc_compare_expr( tc::explicit_cast<bool>((_.m_ ## maskmember) & (maskmember ## maskvalue)) )
#define tc_compare_aspect_if_var( tplbb, expr ) \
if (auto const tplbb = tc_internal_compare_expr(tc_fn(tc::make_tuple), lhs, rhs, tc::explicit_cast<bool>(expr)); tplbb != tc::make_tuple(true,true)) { \
if (tplbb == tc::make_tuple(false, true)) return std::weak_ordering::less; \
else if (tplbb == tc::make_tuple(true, false)) return std::weak_ordering::greater; \
} else \
#define tc_compare_aspect_if( expr ) tc_compare_aspect_if_var(UNIQUE_IDENTIFIER, expr)
#define tc_compare_aspect( maskmember, maskvalue, member ) \
tc_compare_aspect_if((_.m_ ## maskmember) & (maskmember ## maskvalue)) tc_compare_expr( _.member )
#define tc_compare_aspect_lex( maskmember, maskvalue, member ) \
tc_compare_aspect_if((_.m_ ## maskmember) & (maskmember ## maskvalue)) tc_compare_expr_lex( _.member )
#define tc_hash_aspect( maskmember, maskvalue, member ) \
if((t.m_ ## maskmember) & (maskmember ## maskvalue)) { \
tc::hash_append(h, t.member ); \
tc::hash_append(h, true); \
} else { \
tc::hash_append(h, false); \
}
///////////////////////////////////////////////////////////
// compare on specific types
template<typename Rng>
[[nodiscard]] constexpr auto lexicographical_compare_3way(Rng const& rng) noexcept {
#if 0 // TODO Xcode14
return tc::value_or(tc::find_first_if<tc::return_value_or_none>(rng, [](auto const order) {
return tc::is_neq(order);
}), std::weak_ordering::equal);
#else // constexpr workaround
tc::range_value_t<Rng> order=std::weak_ordering::equivalent;
tc::for_each(rng, [&](auto const& order2) noexcept {
if(tc::is_neq(order2)) {
order = order2;
return tc::break_;
}
return tc::continue_;
});
return order;
#endif
}
namespace lexicographical_compare_3way_detail {
TC_DEFINE_ENUM(EPrefix, eprefix, (FORBID)(ALLOW)(EQUIVALENT))
template< EPrefix eprefix, typename Lhs, typename Rhs, typename FnCompare >
constexpr auto lexicographical_compare_3way_impl( Lhs const& lhs, Rhs const& rhs, FnCompare fnCompare) noexcept ->
decltype(fnCompare(*tc::begin(lhs), *tc::begin(rhs)))
{
auto itLhs=tc::begin( lhs );
auto const itLhsEnd=tc::end( lhs );
auto itRhs=tc::begin( rhs );
auto const itRhsEnd=tc::end( rhs );
for(;;) {
if( itLhs==itLhsEnd ) {
if constexpr(eprefixEQUIVALENT==eprefix) {
return std::weak_ordering::equivalent; // if lhs is a prefix of rhs this is considered equivalent
} else {
if( itRhs==itRhsEnd ) {
return std::weak_ordering::equivalent;
} else {
_ASSERTE(eprefixALLOW==eprefix);
return std::weak_ordering::less; // lhs shorter than rhs, thus <
}
}
}
if( itRhs==itRhsEnd ) {
_ASSERTE(eprefixFORBID!=eprefix);
return std::weak_ordering::greater; // rhs shorter than lhs, thus >
}
tc_return_if_not_equal( fnCompare( *itLhs, *itRhs ) );
++itLhs;
++itRhs;
}
}
}
template< typename Lhs, typename Rhs, typename FnCompare = tc::fn_compare >
[[nodiscard]] constexpr auto lexicographical_compare_3way(Lhs const& lhs, Rhs const& rhs, FnCompare&& fnCompare = FnCompare()) noexcept {
return lexicographical_compare_3way_detail::lexicographical_compare_3way_impl<lexicographical_compare_3way_detail::eprefixALLOW>(lhs, rhs, tc_move_if_owned(fnCompare));
}
template< typename Lhs, typename Rhs, typename FnCompare = tc::fn_compare >
[[nodiscard]] constexpr auto lexicographical_compare_3way_noprefix(Lhs const& lhs, Rhs const& rhs, FnCompare&& fnCompare = FnCompare()) noexcept {
return lexicographical_compare_3way_detail::lexicographical_compare_3way_impl<lexicographical_compare_3way_detail::eprefixFORBID>(lhs, rhs, tc_move_if_owned(fnCompare));
}
template< typename Lhs, typename Rhs, typename FnCompare = tc::fn_compare >
[[nodiscard]] constexpr auto lexicographical_compare_3way_prefixequivalence(Lhs const& lhs, Rhs const& rhs, FnCompare&& fnCompare = FnCompare()) noexcept {
return lexicographical_compare_3way_detail::lexicographical_compare_3way_impl<lexicographical_compare_3way_detail::eprefixEQUIVALENT>(lhs, rhs, tc_move_if_owned(fnCompare));
}
tc_define_fn( lexicographical_compare_3way );
tc_define_fn( lexicographical_compare_3way_noprefix );
tc_define_fn( lexicographical_compare_3way_prefixequivalence );
}
#if defined(__clang__) && !defined(__cpp_lib_three_way_comparison) // three way comparison operators are not implemented for library types in Xcode13/14. TODO Xcode15
namespace std { // ADL
template<typename Char, typename CharTraits, typename Alloc>
[[nodiscard]] auto operator<=>(std::basic_string<Char, CharTraits, Alloc> const& lhs, std::basic_string<Char, CharTraits, Alloc> const& rhs) noexcept {
return tc::lexicographical_compare_3way(lhs, rhs);
}
template<typename Char, typename CharTraits, typename Alloc>
[[nodiscard]] auto operator<=>(std::basic_string<Char, CharTraits, Alloc> const& lhs, Char const* rhs) noexcept {
return tc::lexicographical_compare_3way(lhs, rhs);
}
template< typename First, typename Second >
[[nodiscard]] constexpr auto operator<=>(std::pair<First, Second> const& lhs, std::pair<First, Second> const& rhs) noexcept requires requires {
tc::compare(lhs.first, rhs.first);
tc::compare(lhs.second, rhs.second);
} {
tc_compare_expr( _.first );
tc_compare_expr( _.second );
return std::weak_ordering::equivalent;
}
template<typename T, typename Alloc>
[[nodiscard]] auto operator<=>(std::vector<T, Alloc> const& lhs, std::vector<T, Alloc> const& rhs) noexcept {
return tc::lexicographical_compare_3way(lhs, rhs);
}
template<typename T, std::size_t N>
[[nodiscard]] auto operator<=>(std::array<T, N> const& lhs, std::array<T, N> const& rhs) noexcept {
return tc::lexicographical_compare_3way(lhs, rhs);
}
template<typename... T>
[[nodiscard]] constexpr auto operator<=>(std::variant<T...> const& lhs, std::variant<T...> const& rhs) noexcept
requires requires { typename boost::mp11::mp_list<decltype(tc::compare(std::declval<T const&>(), std::declval<T const&>()))...>; }
{
if(lhs.valueless_by_exception() && rhs.valueless_by_exception()) {
return std::weak_ordering::equivalent;
} else if(lhs.valueless_by_exception()) {
return std::weak_ordering::less;
} else if(rhs.valueless_by_exception()) {
return std::weak_ordering::greater;
} else {
tc_compare_expr(_.index());
return tc::fn_visit(
[]<typename TVal>(TVal const& valLhs, TVal const& valRhs) noexcept {
return tc::compare(valLhs, valRhs);
},
tc::never_called<std::weak_ordering>()
)(lhs, rhs);
}
}
template<typename T, typename U>
constexpr auto operator<=>(std::optional<T> const& lhs, std::optional<U> const& rhs ) noexcept -> decltype(tc::compare(*lhs, *rhs)) {
return lhs && rhs ? tc::compare(*lhs, *rhs) : tc::compare(static_cast<bool>(lhs), static_cast<bool>(rhs));
}
template<typename T>
constexpr std::weak_ordering operator<=>(std::optional<T> const& opt, std::nullopt_t) noexcept {
return tc::compare(static_cast<bool>(opt), false);
}
template<typename T, typename U, std::enable_if_t<!tc::instance<U, std::optional>>* = nullptr>
constexpr auto operator<=>(std::optional<T> const& opt, U const& value) noexcept -> decltype(tc::compare(*opt, value)) {
return opt ? tc::compare(*opt, value) : std::weak_ordering::less;
}
}
#endif
namespace tc {
///////////////////////////////////
// argument-wise transformation
namespace no_adl {
// cannot be implemented as a lambda because lambdas are not assignable
template< typename Func, typename Transform>
struct [[nodiscard]] projected_impl /*not final, containers may derive from predicates to benefit from EBCO*/
{
tc::verify_functor_t<tc::decay_t<Func>> m_func;
tc::verify_functor_t<tc::decay_t<Transform>> m_transform;
template <typename... Args>
constexpr auto operator()(Args&&... args) const& return_decltype_allow_xvalue_slow_MAYTHROW(
tc_invoke_pack(m_func, tc_invoke(m_transform, tc_move_if_owned(args)))
)
using is_transparent = void;
};
}
template< typename Func, typename Transform >
constexpr decltype(auto) projected(Func&& func, Transform&& transform) noexcept {
if constexpr( std::is_same<tc::decay_t<Transform>, tc::identity>::value ) {
return tc_move_if_owned(func);
} else {
return no_adl::projected_impl<Func, Transform>{ tc_move_if_owned(func), tc_move_if_owned(transform) };
}
}
///////////////////////////////////
// converse_relation
template<typename Pred>
auto reverse_binary_rel(Pred&& pred) noexcept {
return [pred=tc::decay_copy(tc_move_if_owned(pred))](auto const& lhs, auto const& rhs) noexcept {
return pred(rhs, lhs);
};
}
////////////////////////////////
// Provide adapter from 3-way compare to 2-way compare
template< typename FCompare>
constexpr auto lessfrom3way( FCompare&& fnCompare ) noexcept {
return tc::chained(tc_fn(std::is_lt), tc_move_if_owned(fnCompare));
}
template< typename FCompare>
constexpr auto greaterfrom3way( FCompare&& fnCompare ) noexcept {
return tc::chained(tc_fn(std::is_gt), tc_move_if_owned(fnCompare));
}
template< typename FCompare>
constexpr auto equalfrom3way( FCompare&& fnCompare ) noexcept {
return tc::chained(tc_fn(tc::is_eq), tc_move_if_owned(fnCompare));
}
namespace tuple_adl {
template<typename... T, typename... U> requires requires { typename boost::mp11::mp_list<decltype(tc::compare(std::declval<T const&>(), std::declval<U const&>()))...>; }
constexpr auto operator<=>(tc::tuple<T...> const& lhs, tc::tuple<U...> const& rhs) noexcept {
STATICASSERTEQUAL(sizeof...(T), sizeof...(U));
return tc::lexicographical_compare_3way(
tc::transform(std::index_sequence_for<T...>(), [&](auto const nconstIndex) noexcept -> std::weak_ordering {
return tc::compare(tc::get<nconstIndex()>(lhs), tc::get<nconstIndex()>(rhs));
})
);
}
}
} // namespace tc
#define EQUAL_MEMBER_IMPL(member) (lhs.member == rhs.member)
#define EQUAL_MEMBERS(...) (TC_PP_DELIMIT_TRANSFORMED_SEQ(EQUAL_MEMBER_IMPL, &&, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)))
================================================
FILE: tc/algorithm/element.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "find.h"
#include "../range/range_return.h"
namespace tc {
template <typename RangeReturn>
[[nodiscard]] constexpr decltype(auto) front(auto&& rng) noexcept {
return tc::find_first_if<RangeReturn>(tc_move_if_owned(rng), tc::constexpr_function<true>());
}
template <typename RangeReturn>
[[nodiscard]] constexpr decltype(auto) back(auto&& rng) noexcept {
static_assert( !std::is_same<RangeReturn, tc::return_void>::value );
static_assert( !std::is_same<RangeReturn, tc::return_bool>::value, "Use tc::empty instead of tc::back<tc::return_bool>" );
static_assert( tc::bidirectional_range<std::remove_reference_t<decltype(rng)>> ); // TODO reverse generator would also be fine, but find_last_if is not specialized for this case yet.
return tc::find_last_if<RangeReturn>(tc_move_if_owned(rng), tc::constexpr_function<true>());
}
template <typename RangeReturn>
[[nodiscard]] decltype(auto) linear_back(auto&& rng) noexcept {
static_assert( !std::is_same<RangeReturn, tc::return_void>::value );
static_assert( !std::is_same<RangeReturn, tc::return_bool>::value, "Use tc::empty instead of tc::linear_back<tc::return_bool>" );
static_assert( !tc::bidirectional_range<std::remove_reference_t<decltype(rng)>>, "Use tc::back for bidirectional ranges" );
auto it = tc::begin(rng);
tc_auto_cref(itEnd, tc::end(rng));
if (it!=itEnd) {
auto itNext = it;
while (itEnd!=++itNext) {
it = itNext;
}
return RangeReturn::pack_element(tc_move(it), tc_move_if_owned(rng));
} else {
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
}
}
template <typename RangeReturn>
[[nodiscard]] constexpr auto at(auto&& rng, typename boost::range_size< std::remove_reference_t<decltype(rng)> >::type n) noexcept {
static_assert( !std::is_same<RangeReturn, tc::return_void>::value );
static_assert( !std::is_same<RangeReturn, tc::return_bool>::value, "Use tc::size instead of tc::at<tc::return_bool>" );
if (n<tc::size_raw(rng)) {
_ASSERTE(0<=n);
auto it=tc::begin(rng);
it += n;
return RangeReturn::pack_element(tc_move(it), tc_move_if_owned(rng));
} else {
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
}
}
template <typename RangeReturn>
[[nodiscard]] constexpr auto linear_at(auto&& rng, typename boost::range_size< std::remove_reference_t<decltype(rng)> >::type n) noexcept {
static_assert( !std::is_same<RangeReturn, tc::return_void>::value );
static_assert( !std::is_same<RangeReturn, tc::return_bool>::value, "Use tc::size_bounded instead of tc::linear_at<tc::return_bool>" );
if constexpr (std::convertible_to<typename boost::range_traversal<decltype(rng)>::type, boost::iterators::random_access_traversal_tag>) {
return tc::at<RangeReturn>(tc_move_if_owned(rng), tc_move(n));
} else {
_ASSERTE(0<=n);
tc_auto_cref(itEnd, tc::end(rng));
for (auto it=tc::begin(rng); it!=itEnd; ++it, --n) {
if (0==n) {
return RangeReturn::pack_element(tc_move(it), tc_move_if_owned(rng));
}
}
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
}
}
template <typename RangeReturn>
[[nodiscard]] constexpr auto reverse_at(auto&& rng, typename boost::range_size< std::remove_reference_t<decltype(rng)> >::type n) noexcept {
if (n<tc::size_raw(rng)) {
_ASSERTE(0<=n);
auto it=tc::end(rng);
it -= n+1;
return RangeReturn::pack_element(tc_move(it), tc_move_if_owned(rng));
} else {
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
}
}
namespace only_detail {
template<typename RangeReturn, typename Rng>
tc::element_return_type_t<RangeReturn, Rng> only_not_X(Rng&& rng, auto func) MAYTHROW {
if constexpr(RangeReturn::requires_iterator) {
auto const itEnd = tc::end(rng);
auto const itBegin = tc::begin(rng);
if(itEnd != itBegin && (itEnd == tc_modified(itBegin, ++_) || tc::explicit_cast<bool>(func()))) {
return RangeReturn::pack_element(itBegin, tc_move_if_owned(rng));
} else {
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
}
} else {
std::optional<tc::element_return_type_t<RangeReturn, Rng>> ot;
auto const boc = tc::for_each(tc_move_if_owned(rng), [&](auto&& t) MAYTHROW {
if(!ot) {
tc::optional_emplace(ot, RangeReturn::template pack_element<Rng>(tc_move_if_owned(t))); // MAYTHROW
return tc::continue_;
} else {
return tc::break_;
}
});
if(ot && (tc::continue_ == boc || tc::explicit_cast<bool>(func()))) {
return *tc_move(ot);
} else {
return RangeReturn::template pack_no_element<Rng>();
}
}
}
}
template<typename RangeReturn>
[[nodiscard]] constexpr decltype(auto) only(auto&& rng) MAYTHROW {
static_assert(std::is_same<RangeReturn, tc::return_value>::value || std::is_same<RangeReturn, tc::return_element>::value, "decide between tc::only_not_0<...> and tc::only_not_N<...>"); // Exclude tc::return_XXX_or_YYY. TODO: make static_assert more generic
return tc::find_unique_if<RangeReturn>(tc_move_if_owned(rng), tc::constexpr_function<true>());
}
template<typename RangeReturn>
[[nodiscard]] decltype(auto) only_not_0(auto&& rng) MAYTHROW {
static_assert(!std::is_same<RangeReturn, tc::return_value>::value && !std::is_same<RangeReturn, tc::return_element>::value, "use tc::only<...> instead"); // TODO: make static_assert more generic
return only_detail::only_not_X<RangeReturn>(tc_move_if_owned(rng), tc::never_called<tc::constant<true>>());
}
template<typename RangeReturn>
[[nodiscard]] decltype(auto) only_not_N(auto&& rng) MAYTHROW {
static_assert(!std::is_same<RangeReturn, tc::return_value>::value && !std::is_same<RangeReturn, tc::return_element>::value, "use tc::only<...> instead"); // TODO: make static_assert more generic
return only_detail::only_not_X<RangeReturn>(tc_move_if_owned(rng), tc::constexpr_function<false>());
}
namespace no_adl{
template<typename Element>
struct element_stash_impl final {
static_assert(tc::decayed<Element>);
[[nodiscard]] static constexpr decltype(auto) extract(Element&& elem) noexcept(noexcept(*tc_move(elem))) {
#ifdef _DEBUG
if constexpr(std::is_reference<decltype(*elem)>::value) {
_ASSERTE(std::addressof(*tc::decay_copy(elem))==std::addressof(*elem)); // specialize is_stashing_element<Element>
}
#endif
return *tc_move(elem);
}
};
#ifdef _MSC_VER
// If Element is of type T(*)[N], MSVC erroneously deduces return type T(*)[N] for element_stash_impl<Element>::extract,
// and then raises a compiler error that it cannot convert from T[N] to T(*)[N] in the return statement.
// Clang correctly deduces return type T(&)[N]. Add specialization for array types to workaround this problem.
template<typename T, std::size_t N>
struct element_stash_impl<T(*)[N]> final {
using array_type=T[N];
[[nodiscard]] static constexpr array_type& extract(T(*a)[N]) noexcept {
return *a;
}
};
#endif
// MSVC 19.31.31104 claims tc::is_stashing_element<Element>::value is not of type bool when directly used in a requires clause on element_stash_impl<Element>.
// Outline to template variable to avoid silent bad codegen due to wrong sfinae.
template<typename Element>
inline bool constexpr is_stashing_element_v = tc::is_stashing_element<Element>::value;
// Lifetime of reference is bound to the iterator -> must keep iterator alive
template<typename Element> requires is_stashing_element_v<Element>
struct element_stash_impl<Element> final : tc::storage_for_dtor_at_end_of_scope<Element> {
static_assert(tc::decayed<Element>);
[[nodiscard]] constexpr decltype(auto) extract(Element&& elem) & noexcept(noexcept(*tc_move_always(this->operator*()))) { // note that constexpr only works for trivially constructible/assignable/destructible type
this->ctor(tc_move(elem));
return *tc_move_always(this->operator*());
}
};
}
template<typename Rng>
using element_stash = no_adl::element_stash_impl<tc::iterator_t<Rng>>;
#pragma push_macro("RETURN_REFERENCE_FROM_ELEMENT")
// Make first template argument non-type to avoid name(rng) instantiating name<tc::return_element, Rng> and then name<tc::return_element, tc::return_element> which leads to hard error.
#define RETURN_REFERENCE_FROM_ELEMENT(name) \
template <int = 0, typename Rng> \
[[nodiscard]] constexpr decltype(auto) name( \
Rng&& rng, \
tc::element_stash<Rng>&& stash={} \
) return_MAYTHROW( \
stash.extract(tc::name<tc::return_element>(tc_move_if_owned(rng))) \
) \
\
/* Use tc::fn_front() instead of tc_fn(tc::front) because the latter returns a dangling xvalue reference when used with counting ranges. */ \
/* Support tc::fn_front<tc::return_xxx>() for consistency*/ \
namespace no_adl { \
template<typename RangeReturn=void> \
struct [[nodiscard]] fn_ ## name final { \
template <typename Rng> requires tc::borrowed_range<Rng> \
auto operator()(Rng&& rng) const& return_decltype_allow_xvalue_MAYTHROW( \
tc::name<RangeReturn>(tc_unwrap_temporary(tc_move_if_owned(rng))) \
) \
template <typename Rng> \
auto operator()(Rng&& rng) const& return_decltype_allow_xvalue_MAYTHROW( \
tc_rewrap_temporary(Rng, tc::name<RangeReturn>(tc_unwrap_temporary(tc_move_if_owned(rng)))) \
) \
}; \
template<> \
struct [[nodiscard]] fn_ ## name<void> final { \
template <typename Rng> requires tc::borrowed_range<Rng> || tc::is_stashing_element<tc::iterator_t<Rng>>::value \
auto operator()(Rng&& rng, tc::element_stash<Rng>&& stash={}) const& return_decltype_allow_xvalue_MAYTHROW( \
tc::name(tc_unwrap_temporary(tc_move_if_owned(rng)), tc_move(stash)) \
) \
template <typename Rng> \
auto operator()(Rng&& rng, tc::element_stash<Rng>&& stash={}) const& return_decltype_allow_xvalue_MAYTHROW( \
tc_rewrap_temporary(Rng, tc::name(tc_unwrap_temporary(tc_move_if_owned(rng)), tc_move(stash))) \
) \
}; \
} \
using no_adl::fn_ ## name;
RETURN_REFERENCE_FROM_ELEMENT(front)
RETURN_REFERENCE_FROM_ELEMENT(back)
RETURN_REFERENCE_FROM_ELEMENT(linear_back)
RETURN_REFERENCE_FROM_ELEMENT(only)
#pragma pop_macro("RETURN_REFERENCE_FROM_ELEMENT")
#pragma push_macro("RETURN_REFERENCE_FROM_INDEXED_ELEMENT")
#define RETURN_REFERENCE_FROM_INDEXED_ELEMENT(fn) \
template <int = 0, typename Rng> \
[[nodiscard]] constexpr decltype(auto) fn( \
Rng&& rng, \
typename boost::range_size< std::remove_reference_t<Rng> >::type i, \
tc::element_stash<Rng>&& stash={} \
) return_MAYTHROW( \
stash.extract(tc::fn<tc::return_element>(tc_move_if_owned(rng), tc_move(i))) \
)
RETURN_REFERENCE_FROM_INDEXED_ELEMENT(at)
RETURN_REFERENCE_FROM_INDEXED_ELEMENT(linear_at)
RETURN_REFERENCE_FROM_INDEXED_ELEMENT(reverse_at)
#pragma pop_macro("RETURN_REFERENCE_FROM_INDEXED_ELEMENT")
// Write as macros to keep temporary iterators alive.
// By standard, the lifetime of a reference is limited to the lifetime of the iterator.
#define tc_front_nodebug(rng) (*tc::begin(rng))
#define tc_at_nodebug(rng, i) *(tc::begin(rng) + static_cast<decltype(tc::begin(rng) - tc::begin(rng))>(i))
template<typename Rng, typename Func>
bool if_nonempty_with_only(Rng&& rng, Func func) MAYTHROW {
bool bCalled=false;
tc::for_each(tc_move_if_owned(rng), [&](auto&&... args) MAYTHROW {
VERIFY(tc::change(bCalled, true)); // only a single element is allowed
RETURNS_VOID( func(tc_move_if_owned(args)...) ); // MAYTHROW
return tc::constant<tc::continue_>();
});
return bCalled;
}
template<typename Rng, typename Func>
bool if_nonempty_with_front(Rng&& rng, Func func) MAYTHROW {
return tc::break_==tc::for_each(tc_move_if_owned(rng), [&](auto&&... args) MAYTHROW{
RETURNS_VOID(func(tc_move_if_owned(args)...)); // MAYTHROW
return tc::constant<tc::break_>();
});
}
template<typename RangeReturn, typename T, typename Rng>
[[nodiscard]] std::pair<tc::element_return_type_t<RangeReturn, Rng>, T> front_and_size_bounded(Rng&& rng, T nMax) MAYTHROW {
static_assert(!RangeReturn::requires_iterator, "implement iterator version if needed");
tc::storage_for<tc::element_return_type_t<RangeReturn, Rng>> ot;
T n=0;
tc::for_each(tc_move_if_owned(rng), [&](auto&& t) MAYTHROW {
if (0==n) {
ot.ctor(RangeReturn::template pack_element<Rng>(tc_move_if_owned(t)));
}
++n;
return (nMax<=n) ? tc::break_ : tc::continue_;
});
if (0==n) {
tc_return_cast(RangeReturn::template pack_no_element<Rng>(), tc_move(n));
} else {
tc_scope_exit { ot.dtor(); };
tc_return_cast(*tc_move(ot), tc_move(n));
}
}
}
================================================
FILE: tc/algorithm/element.t.cpp
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#include "element.h"
#include "../unittest.h"
#include "../array.h"
namespace {
UNITTESTDEF( front ) {
_ASSERTEQUAL(tc::front<tc::return_value>(tc::single(1)), 1);
_ASSERTEQUAL(*tc::front<tc::return_element>(tc::single(1)), 1);
_ASSERTEQUAL(tc::front<tc::return_value_or_none>(tc::make_empty_range<int>()), std::nullopt);
}
}
================================================
FILE: tc/algorithm/empty.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
// 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
#pragma once
#include "../base/assert_defs.h"
#include "../base/trivial_functors.h"
#include "for_each.h"
namespace tc {
namespace empty_internal {
// TODO: inline when clang supports lambdas in unevaluated contexts
template<typename Rng>
constexpr auto empty(Rng&& rng) noexcept {
if constexpr(has_constexpr_size<Rng>) {
return [&]() return_decltype_noexcept(0==constexpr_size<Rng>());
} else if constexpr(has_mem_fn_empty<Rng>) {
return [&]() return_MAYTHROW(tc_move_if_owned(rng).empty());
} else if constexpr(tc::range_with_iterators<Rng>) {
return [&]() return_MAYTHROW(tc::at_end_index(rng, tc::begin_index(rng)));
} else if constexpr(has_size<Rng>) {
return [&]() return_MAYTHROW(0==tc::size(tc_move_if_owned(rng))); // tc::size on files may throw
} else {
return [&]() return_MAYTHROW(tc::continue_==tc::for_each(tc_move_if_owned(rng), tc::constexpr_function<tc::constant<tc::break_>{}>()));
}
}
}
template<typename Rng>
[[nodiscard]] constexpr bool empty(Rng&& rng) return_MAYTHROW(
empty_internal::empty(tc_move_if_owned(rng))()
)
}
================================================
FILE: tc/algorithm/empty.t.cpp
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#include "../base/assert_defs.h"
#include "../unittest.h"
#include "../algorithm/empty.h"
#include "../container/insert.h"
namespace {
struct empty_generator {
template<typename Func> tc::break_or_continue operator()(Func) const { return tc::continue_; }
};
struct non_empty_generator {
template<typename Func> tc::break_or_continue operator()(Func func) const { return tc::continue_if_not_break(func, 1); }
};
UNITTESTDEF( empty_range ) {
{ // test container with empty() method
tc::vector<int> vec;
static_assert( has_mem_fn_empty<decltype(vec)> );
_ASSERT( tc::empty(vec) );
_ASSERT( tc::empty(vec) );
tc::cont_emplace_back(vec, 1);
_ASSERT( !tc::empty(vec) );
_ASSERT( !tc::empty(vec) );
}
{ // test iterator range
static_assert( !has_mem_fn_empty<tc::decay_t<decltype("")> > );
static_assert( tc::range_with_iterators<decltype("")> );
_ASSERT( tc::empty("") );
static_assert( !has_mem_fn_empty<tc::decay_t<decltype("x")> > );
static_assert( tc::range_with_iterators<decltype("x")> );
_ASSERT( !tc::empty("x") );
}
{ // test generator range
_ASSERT( tc::empty( empty_generator() ) );
_ASSERT( !tc::empty( non_empty_generator() ) );
}
}
}
================================================
FILE: tc/algorithm/equal.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../base/assert_defs.h"
#include "../base/noncopyable.h"
#include "../base/as_lvalue.h"
#include "../base/modified.h"
#include "for_each.h"
#include "../base/change.h"
#include <boost/range/iterator.hpp>
#include <functional>
#include <unordered_set>
#include <unordered_map>
namespace tc{
namespace no_adl {
template< typename Lhs, typename Rhs>
struct has_parse_match final : tc::constant<false> {};
template< typename Lhs, typename Rhs >
requires requires (Lhs const& lhs, Rhs const& rhs) { lhs.parse_match(rhs); }
struct has_parse_match<Lhs, Rhs> final : tc::constant<true> {};
}
template<typename Lhs, typename Rhs, std::enable_if_t<!no_adl::has_parse_match<Lhs, Rhs>::value && !no_adl::has_parse_match<Rhs, Lhs>::value>* =nullptr>
[[nodiscard]] constexpr auto equal_to_or_parse_match(Lhs const& lhs, Rhs const& rhs) return_decltype_MAYTHROW( tc::equal_to(lhs,rhs) )
template<typename Lhs, typename Rhs, std::enable_if_t<no_adl::has_parse_match<Lhs, Rhs>::value && !no_adl::has_parse_match<Rhs, Lhs>::value>* =nullptr>
[[nodiscard]] constexpr auto equal_to_or_parse_match(Lhs const& lhs, Rhs const& rhs) return_decltype_MAYTHROW( tc::implicit_cast<bool>(lhs.parse_match(rhs)) )
template<typename Lhs, typename Rhs, std::enable_if_t<!no_adl::has_parse_match<Lhs, Rhs>::value && no_adl::has_parse_match<Rhs, Lhs>::value>* =nullptr>
[[nodiscard]] constexpr auto equal_to_or_parse_match(Lhs const& lhs, Rhs const& rhs) return_decltype_MAYTHROW( tc::implicit_cast<bool>(rhs.parse_match(lhs)) )
tc_define_fn( equal_to_or_parse_match );
//-------------------------------------------------------------------------------------------------------------------------
// equal - check whether two ranges are equal - overloaded for combinations of generator and iterator based ranges
namespace equal_impl {
namespace no_adl {
template<typename Pred>
struct reverse_pred {
Pred& m_pred;
constexpr reverse_pred(Pred& pred) noexcept
: m_pred(pred)
{}
template<typename Arg1, typename Arg2>
constexpr auto operator()(Arg1&& arg1, Arg2&& arg2) const& noexcept {
return m_pred(tc_move_if_owned(arg2), tc_move_if_owned(arg1));
}
};
template<typename It, typename ItEnd, typename Pred>
struct is_equal_elem /*final*/ {
constexpr explicit is_equal_elem(
It& it,
ItEnd itEnd,
Pred& pred
) noexcept
: m_it(it)
, m_itEnd(tc_move(itEnd))
, m_pred(pred)
{}
template<typename Elem> requires requires(Pred& pred, It& it, Elem const& elem) { tc_invoke(pred, tc::as_const(*it), elem); }
constexpr break_or_continue operator()(Elem const& elem) const& noexcept {
if (m_it == m_itEnd || !tc::explicit_cast<bool>(tc_invoke(m_pred, tc::as_const(*m_it), elem))) { return tc::break_; }
++m_it;
return tc::continue_;
}
private:
It& m_it;
ItEnd m_itEnd;
Pred& m_pred;
};
// TODO: this does not protect us against inputs such as transform(unordered_set)
template<typename X> struct is_unordered_range : tc::constant<false> {};
template<typename... X> struct is_unordered_range<std::unordered_set<X...>> : tc::constant<true> {};
template<typename... X> struct is_unordered_range<std::unordered_map<X...>> : tc::constant<true> {};
}
template<typename It, typename ItEnd, typename RRng, typename Pred>
[[nodiscard]] constexpr bool starts_with(It& it, ItEnd itEnd, RRng&& rrng, Pred pred) noexcept(noexcept(tc::continue_ == tc::for_each(tc_move_if_owned(rrng), no_adl::is_equal_elem<It, ItEnd, Pred>(it, tc_move(itEnd), pred)))) {
static_assert(!no_adl::is_unordered_range<tc::decay_t<RRng>>::value);
return tc::continue_ == tc::for_each(tc_move_if_owned(rrng), no_adl::is_equal_elem<It, ItEnd, Pred>(it, tc_move(itEnd), pred)); // MAYTHROW
}
}
template<typename RangeReturn, typename LRng, typename RRng, typename Pred>
[[nodiscard]] constexpr decltype(auto) starts_with(LRng&& lrng, RRng const& rrng, Pred&& pred) noexcept {
static_assert(!equal_impl::no_adl::is_unordered_range<tc::decay_t<LRng>>::value);
auto itlrng = tc::begin(lrng);
return equal_impl::starts_with(itlrng, tc::end(lrng), rrng, tc_move_if_owned(pred))
? RangeReturn::pack_border(itlrng, tc_move_if_owned(lrng))
: RangeReturn::pack_no_border(tc_move_if_owned(lrng));
}
template<typename RangeReturn, typename LRng, typename RRng>
[[nodiscard]] constexpr decltype(auto) starts_with(LRng&& lrng, RRng const& rrng) noexcept {
return starts_with<RangeReturn>(tc_move_if_owned(lrng), rrng, tc::fn_equal_to_or_parse_match());
}
template<tc::range_with_iterators LRng, typename RRng, typename Pred>
requires (tc::prefers_for_each<std::remove_reference_t<RRng>> || (!tc::prefers_for_each<LRng>))
&& requires(LRng const& lrng, RRng&& rrng){ equal_impl::starts_with(tc::as_lvalue(tc::begin(lrng)), tc::as_const(tc::as_lvalue(tc::end(lrng))), tc_move_if_owned(rrng), std::declval<Pred>()); }
[[nodiscard]] constexpr bool equal(LRng const& lrng, RRng&& rrng, Pred&& pred) MAYTHROW {
static_assert(!equal_impl::no_adl::is_unordered_range<tc::decay_t<LRng>>::value);
constexpr bool bHasSize=tc::has_size<LRng> && tc::has_size<RRng>;
if constexpr(bHasSize) {
if(tc::size(lrng)!=tc::size(rrng)) return false;
}
auto it = tc::begin(lrng);
tc_auto_cref(itEnd, tc::end(lrng));
return equal_impl::starts_with(it,itEnd,tc_move_if_owned(rrng),tc_move_if_owned(pred)) && (bHasSize || itEnd==it); // MAYTHROW
}
// forward to the symmetric case above
template<typename LRng, tc::range_with_iterators RRng, typename Pred>
requires tc::prefers_for_each<std::remove_reference_t<LRng>>
&& (!tc::prefers_for_each<RRng>)
[[nodiscard]] constexpr bool equal(LRng&& lrng, RRng const& rrng, Pred pred) noexcept {
return tc::equal(rrng, tc_move_if_owned(lrng), equal_impl::no_adl::reverse_pred<Pred>(pred));
}
// is_arithmetic helpful for generic programming
// only do if semantics are clear-cut
template<typename T, typename Pred> requires std::is_arithmetic< T >::value
[[nodiscard]] constexpr bool equal(T const& lhs, T const& rhs, Pred pred) noexcept {
return pred(lhs,rhs);
}
template<typename R, typename S, typename T, typename U, typename Pred>
[[nodiscard]] constexpr bool equal(std::pair<R,S> const& lhs, std::pair<T,U> const& rhs, Pred pred) noexcept {
return tc::equal(lhs.first, rhs.first, pred) && tc::equal(lhs.second, rhs.second, pred);
}
// forward the non predicate version
template<typename LRng, typename RRng>
[[nodiscard]] constexpr bool equal(LRng&& lrng, RRng&& rrng) return_MAYTHROW(
tc::equal(tc_move_if_owned(lrng), tc_move_if_owned(rrng), tc::fn_equal_to_or_parse_match())
)
DEFINE_FN2(tc::equal, fn_equal) // no tc_define_fn to avoid ADL
// boost::ends_with does not work with boost::range_iterator<transform_range>::type returning by value because it has input_iterator category
template<typename RangeReturn, typename LRng, typename RRng, typename Pred=tc::fn_equal_to_or_parse_match>
[[nodiscard]] constexpr decltype(auto) ends_with(LRng&& lrng, RRng const& rrng, Pred pred=Pred()) noexcept {
auto itL=tc::end(lrng);
auto itR=tc::end(rrng);
auto const itBeginL=tc::begin(lrng);
auto const itBeginR=tc::begin(rrng);
for(;;) {
if( itR==itBeginR ) return RangeReturn::pack_border(itL, tc_move_if_owned(lrng));
if( itL==itBeginL ) return RangeReturn::pack_no_border(tc_move_if_owned(lrng));
--itR;
--itL;
if( !tc::explicit_cast<bool>(pred(tc::as_const(*itL),tc::as_const(*itR))) ) return RangeReturn::pack_no_border(tc_move_if_owned(lrng));
}
}
namespace value_equal_to_detail {
template<typename T>
concept safe_value =
!tc::range_with_iterators<T> ||
!tc::range_with_iterators<tc::mp_only<typename tc::is_instance<T, std::optional>::arguments>>;
}
template <typename Lhs, typename Rhs>
[[nodiscard]] constexpr bool value_equal_to(Lhs const& lhs, Rhs const& rhs) noexcept {
if constexpr( tc::range_with_iterators<Lhs> && tc::range_with_iterators<Rhs> ) {
STATICASSERTEQUAL( TC_FWD(tc::instance<Lhs, std::optional>), TC_FWD(tc::instance<Rhs, std::optional>) );
return tc::equal(lhs, rhs, tc::equal_to);
} else {
static_assert( value_equal_to_detail::safe_value<Lhs> );
static_assert( value_equal_to_detail::safe_value<Rhs> );
return tc::equal_to(lhs, rhs);
}
}
}
================================================
FILE: tc/algorithm/equal.t.cpp
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#include "../base/assert_defs.h"
#include "../unittest.h"
namespace {
//---- Equal with vector<int> -------------------------------------------------------------------------------------------------
UNITTESTDEF( equal_vec_int ) {
tc::vector<int> ve;
tc::vector<int> ve_1;
TEST_init_hack(tc::vector, int, v123, {1,2,3});
TEST_init_hack(tc::vector, int, v123_1, {1,2,3});
TEST_init_hack(tc::vector, int, v143, {1,4,3});
TEST_init_hack(tc::vector, int, v1234, {1,2,3,4});
TEST_RANGE_EQUAL(ve, ve);
TEST_RANGE_EQUAL(ve, ve_1);
TEST_RANGE_NOT_EQUAL(ve, v123);
TEST_RANGE_NOT_EQUAL(v123, ve);
TEST_RANGE_EQUAL(v123, v123);
TEST_RANGE_EQUAL(v123, v123_1);
TEST_RANGE_NOT_EQUAL(v123, v143);
TEST_RANGE_NOT_EQUAL(v123, v1234);
TEST_RANGE_NOT_EQUAL(v1234, v123);
}
UNITTESTDEF( equal_vec_int_pred ) {
TEST_init_hack(tc::vector, int, v123, {1,2,3});
TEST_init_hack(tc::vector, int, v234, {2,3,4});
tc_static_auto_constexpr_lambda(ofByOne) = [](int const lhs, int const rhs) noexcept { return (lhs + 1) == rhs; }; // unsymmetrical to uncover wrong order of argument application to the predicate
_ASSERT(tc::equal(v123, v234, ofByOne));
_ASSERT(!tc::equal(v234, v123, ofByOne));
_ASSERT(!tc::equal(v123, v123, ofByOne));
}
//---- Equal with generators --------------------------------------------------------------------------------------------------
UNITTESTDEF( equal_generator ) {
tc::vector<int> ve;
tc::vector<int> ve_1;
TEST_init_hack(tc::vector, int, v123, {1,2,3});
TEST_init_hack(tc::vector, int, v123_1, {1,2,3});
TEST_init_hack(tc::vector, int, v143, {1,4,3});
TEST_init_hack(tc::vector, int, v1234, {1,2,3,4});
auto ge = tc::make_generator_range(ve);
auto g123 = tc::make_generator_range(v123);
auto g143 = tc::make_generator_range(v143);
auto g1234 = tc::make_generator_range(v1234);
STATIC_ASSERT(tc::range_with_iterators<decltype(ve)>);
STATIC_ASSERT(!tc::range_with_iterators<decltype(ge)>);
TEST_RANGE_EQUAL(ve, ge);
TEST_RANGE_EQUAL(ge, ve);
//TEST_RANGE_EQUAL(ge, ge); // Fails to compile with proper msg, as it should be.
TEST_RANGE_EQUAL(v123, g123);
TEST_RANGE_EQUAL(g123, v123);
TEST_RANGE_EQUAL(v1234, g1234);
TEST_RANGE_EQUAL(g1234, v1234);
TEST_RANGE_NOT_EQUAL(v123, g143);
TEST_RANGE_NOT_EQUAL(g123, v143);
TEST_RANGE_NOT_EQUAL(v123, g1234);
TEST_RANGE_NOT_EQUAL(g123, v1234);
TEST_RANGE_NOT_EQUAL(v1234, g123);
TEST_RANGE_NOT_EQUAL(g1234, v123);
}
UNITTESTDEF( equal_generator_pred ) {
TEST_init_hack(tc::vector, int, v123, {1,2,3});
TEST_init_hack(tc::vector, int, v234, {2,3,4});
auto g123 = tc::make_generator_range(v123);
auto g234 = tc::make_generator_range(v234);
tc_static_auto_constexpr_lambda(ofByOne) = [](int const lhs, int const rhs) noexcept { return (lhs + 1) == rhs; }; // unsymmetrical to uncover wrong order of argument application to the predicate
//_ASSERT(tc::equal(g123, g234, ofByOne)); // Fails to compile with proper msg, as it should be.
_ASSERT(tc::equal(v123, g234, ofByOne));
_ASSERT(!tc::equal(v234, g123, ofByOne));
_ASSERT(!tc::equal(v123, g123, ofByOne));
_ASSERT(tc::equal(g123, v234, ofByOne));
_ASSERT(!tc::equal(g234, v123, ofByOne));
_ASSERT(!tc::equal(g123, v123, ofByOne));
}
UNITTESTDEF( variadic_assign_better ) {
int nVar = 5;
bool b=tc::assign_better(tc::fn_less(), nVar, 6, 5, 9);
_ASSERT(!b);
_ASSERTEQUAL(nVar, 5);
b=tc::assign_better(tc::fn_less(), nVar, 3);
_ASSERT(b);
_ASSERTEQUAL(nVar, 3);
b=tc::assign_better(tc::fn_less(), nVar, 5, 2, 8, 0);
_ASSERT(b);
_ASSERTEQUAL(nVar, 0);
}
namespace no_adl {
template<typename Better, typename List>
struct has_assign_better_impl final: tc::constant<false> {};
template<typename Better, typename Var, typename... Val>
requires requires(Better&& better, Var&& var, Val&&... val) { tc::assign_better(tc_move_if_owned(better), tc_move_if_owned(var), tc_move_if_owned(val)...);}
struct has_assign_better_impl<Better, boost::mp11::mp_list<Var, Val...>> final: tc::constant<true> {};
template<typename Better, typename... T>
using has_assign_better = has_assign_better_impl<Better, boost::mp11::mp_list<T...>>;
}
#ifndef __EMSCRIPTEN__
static_assert(!no_adl::has_assign_better<tc::fn_less, std::atomic<int>, int>::value);
static_assert(!no_adl::has_assign_better<tc::fn_less, std::atomic<int>, int, int>::value);
static_assert(no_adl::has_assign_better<tc::fn_less, std::atomic<int>&, int>::value);
static_assert(no_adl::has_assign_better<tc::fn_less, std::atomic<int>&, int, int>::value);
#endif
static_assert(no_adl::has_assign_better<tc::fn_less, int&, int>::value);
static_assert(no_adl::has_assign_better<tc::fn_less, int&, int, int>::value);
}
================================================
FILE: tc/algorithm/filter_inplace.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../base/assert_defs.h"
#include "../range/meta.h"
#include "../range/range_return.h"
#include "../container/container_traits.h"
#include "../storage_for.h"
#include "restrict_size_decrement.h"
namespace tc {
template <typename T>
struct range_filter_by_move_element : tc::constant<
tc::instance<T, std::basic_string> || tc::instance<T, std::vector>
> {};
template<typename Cont>
struct range_filter;
template<typename Cont> requires
has_efficient_erase<Cont>::value ||
has_mem_fn_lower_bound<Cont> ||
has_mem_fn_hash_function<Cont>
struct range_filter<Cont> : tc::noncopyable {
static_assert(tc::decayed<Cont>);
private:
Cont& m_cont;
tc::iterator_t<Cont> m_itOutputEnd;
public:
explicit constexpr range_filter(Cont& cont) noexcept
: m_cont(cont)
, m_itOutputEnd(tc::begin(cont))
{}
constexpr range_filter(Cont& cont, tc::iterator_t<Cont> const& itStart) noexcept
: m_cont(cont)
, m_itOutputEnd(itStart)
{}
constexpr ~range_filter() {
tc::take_inplace(m_cont, m_itOutputEnd);
}
constexpr void keep(tc::iterator_t<Cont> it) & noexcept {
#ifdef _CHECKS
auto const nDistance = std::distance(m_itOutputEnd, it);
_ASSERTE( 0<=nDistance );
auto const rsize = restrict_size_decrement(m_cont, nDistance, nDistance);
#endif
m_itOutputEnd=m_cont.erase(m_itOutputEnd,it);
++m_itOutputEnd;
}
///////////////////////////////////////////
// range interface for output range
// no deep constness (analog to subrange)
constexpr auto begin() const& noexcept {
return tc::begin(m_cont);
}
constexpr auto end() const& noexcept {
return m_itOutputEnd;
}
constexpr void pop_back() & noexcept requires (!has_mem_fn_hash_function<Cont>) {
_ASSERTE( m_itOutputEnd!=tc::begin(m_cont) );
auto const rsize = restrict_size_decrement(m_cont);
--m_itOutputEnd;
m_itOutputEnd=m_cont.erase(m_itOutputEnd);
}
};
template<has_mem_fn_splice Cont>
struct range_filter<Cont> : Cont, private tc::noncopyable {
static_assert(tc::decayed<Cont>);
Cont& m_contInput;
explicit constexpr range_filter(Cont& cont) noexcept
: m_contInput(cont)
{}
constexpr range_filter(Cont& cont, tc::iterator_t<Cont> const& itStart) noexcept
: m_contInput(cont)
{
this->splice( tc::end(*this), m_contInput, tc::begin(m_contInput), itStart );
}
constexpr ~range_filter() {
m_contInput=tc_move_always( tc::base_cast<Cont>(*this) );
}
constexpr void keep(tc::iterator_t<Cont> it) & noexcept {
_ASSERTE( it!=tc::end(m_contInput) );
this->splice(
tc::end(*this),
m_contInput,
m_contInput.erase( tc::begin(m_contInput), it )
);
}
};
template<typename Cont> requires range_filter_by_move_element<Cont>::value
struct range_filter<Cont> : tc::noncopyable {
static_assert(tc::decayed<Cont>);
protected:
Cont& m_cont;
tc::iterator_t<Cont> m_itOutput;
private:
#ifdef _CHECKS
tc::iterator_t<Cont> m_itFirstValid;
#endif
public:
explicit constexpr range_filter(Cont& cont) noexcept
: m_cont(cont)
, m_itOutput(tc::begin(cont))
#ifdef _CHECKS
, m_itFirstValid(tc::begin(cont))
#endif
{}
explicit constexpr range_filter(Cont& cont, tc::iterator_t<Cont> itStart) noexcept
: m_cont(cont)
, m_itOutput(itStart)
#ifdef _CHECKS
, m_itFirstValid(itStart)
#endif
{}
constexpr ~range_filter() {
tc::take_inplace( m_cont, m_itOutput );
}
constexpr void keep(tc::iterator_t<Cont> it) & noexcept {
#ifdef _CHECKS
// Filter without reordering
_ASSERTE( 0<=std::distance(m_itFirstValid, it) );
m_itFirstValid=it;
++m_itFirstValid;
#endif
if (it != m_itOutput) { // self assignment with r-value-references is not allowed (17.6.4.9)
*m_itOutput=tc_move_always(*it);
}
++m_itOutput;
}
///////////////////////////////////
// range interface for output range
// no deep constness (analog to subrange)
constexpr auto begin() const& noexcept {
return tc::begin(m_cont);
}
constexpr auto end() const& noexcept {
return m_itOutput;
}
constexpr void pop_back() & noexcept {
_ASSERTE( tc::begin(m_cont)!=m_itOutput );
--m_itOutput;
}
template <typename... Ts>
constexpr void emplace_back(Ts&&... ts) & MAYTHROW {
_ASSERTE( tc::end(m_cont)!=m_itOutput );
tc::assign_explicit_cast(*m_itOutput, tc_move_if_owned(ts)...); // MAYTHROW
++m_itOutput;
}
};
/////////////////////////////////////////////////////
// filter_inplace
template<typename Cont, typename Pred = tc::identity>
void filter_inplace(Cont & cont, tc::iterator_t<Cont> it, Pred pred = Pred()) noexcept(noexcept(tc_invoke(pred, *it))) {
for (auto const itEnd = tc::end(cont); it != itEnd; ++it) {
if (!tc::explicit_cast<bool>(tc_invoke(pred, *it))) {
tc::range_filter< tc::decay_t<Cont> > rngfilter(cont, it);
++it;
while (it != itEnd) {
// taking further action to destruct *it when returning false is legitimate use case, so do do not enforce const
if (tc_invoke(pred, *it)) {
rngfilter.keep(it++); // may invalidate it, so move away first
} else {
++it;
}
}
break;
}
}
}
template<typename Cont, typename Pred = tc::identity>
void filter_inplace(Cont& cont, Pred&& pred = Pred()) return_MAYTHROW(
tc::filter_inplace(cont, tc::begin(cont), tc_move_if_owned(pred))
)
}
================================================
FILE: tc/algorithm/find.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../base/assert_defs.h"
#include "../range/meta.h"
#include "../range/iterator_cache.h"
#include "../base/scope.h"
#include "../base/trivial_functors.h"
#include "../storage_for.h"
#include "equal.h"
namespace tc {
namespace no_adl {
#ifdef _MSC_VER
template<typename RangeReturn, typename Rng>
struct element_return_type : std::type_identity<decltype(RangeReturn::pack_no_element(std::declval<Rng>()))> {};
#endif
}
#ifdef _MSC_VER // MSVC has problems with decltype in alias templates.
template<typename RangeReturn, typename Rng>
using element_return_type_t = typename no_adl::element_return_type<RangeReturn, Rng>::type;
#else
template<typename RangeReturn, typename Rng>
using element_return_type_t = decltype(RangeReturn::pack_no_element(std::declval<Rng>()));
#endif
namespace find_first_if_detail {
template< typename RangeReturn, IF_TC_CHECKS(bool c_bCheckUnique,) typename Rng >
[[nodiscard]] constexpr tc::element_return_type_t<RangeReturn, Rng> find_first_if(Rng&& rng, auto pred) MAYTHROW {
if constexpr( RangeReturn::requires_iterator ) {
auto const itEnd=tc::end(rng); // MAYTHROW
for( auto it=tc::begin(rng) /*MAYTHROW*/; it!=itEnd; ++it /*MAYTHROW*/ ) {
if constexpr(std::same_as<decltype(pred), tc::constexpr_function<true>>) { // tc::front
#ifdef _CHECKS
if constexpr( c_bCheckUnique ) { // tc::only
_ASSERTE( tc_modified(it, ++_) == itEnd );
}
#endif
return RangeReturn::pack_element(tc_move(it),tc_move_if_owned(rng)); // MAYTHROW
} else {
decltype(auto) ref = *it; // MAYTHROW
if (tc::explicit_cast<bool>(tc_invoke(pred, tc::as_const(ref)) /*MAYTHROW*/)) {
#ifdef _CHECKS
if constexpr( c_bCheckUnique ) {
for( auto it2 = tc_modified(it, ++_); it2!=itEnd; ++it2 ) { // hand-rolled loop to avoid dependency to subrange
_ASSERTE( !tc::explicit_cast<bool>(tc_invoke(pred, tc::as_const(*it2))) );
}
}
#endif
return RangeReturn::pack_element(tc_move(it),tc_move_if_owned(rng),tc_move_if_owned(ref)); // MAYTHROW
}
}
}
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
} else {
#ifdef _CHECKS
if constexpr( c_bCheckUnique ) {
std::optional<tc::element_return_type_t<RangeReturn, Rng>> ot;
tc::for_each(tc_move_if_owned(rng), [&](auto&& t) MAYTHROW {
if( tc::explicit_cast<bool>(tc_invoke(pred, tc::as_const(t)) /*MAYTHROW*/) ) {
VERIFYCRITICALPRED(ot, !_).emplace(RangeReturn::template pack_element<Rng>(tc_move_if_owned(t)) /* MAYTHROW */);
}
}); // MAYTHROW
if( ot ) return *tc_move(ot);
} else
#endif
{
tc::storage_for_without_dtor<tc::element_return_type_t<RangeReturn, Rng>> ot;
if( tc::break_ == tc::for_each(tc_move_if_owned(rng), [&](auto&& t) MAYTHROW {
if (tc::explicit_cast<bool>(tc_invoke(pred, tc::as_const(t)) /*MAYTHROW*/)) {
ot.ctor(RangeReturn::template pack_element<Rng>(tc_move_if_owned(t)) /* MAYTHROW */);
return tc::break_; // We assume for_each never throws exceptions after the sink returned break_.
} else {
return tc::continue_;
}
}) /* MAYTHROW */ ) {
tc_scope_exit { ot.dtor(); };
return *tc_move(ot);
}
}
return RangeReturn::template pack_no_element<Rng>();
}
}
}
template< typename RangeReturn, typename Rng, typename Pred = tc::identity >
[[nodiscard]] constexpr decltype(auto) find_first_if(Rng&& rng, Pred&& pred = Pred()) MAYTHROW {
return find_first_if_detail::find_first_if<RangeReturn IF_TC_CHECKS(, /*c_bCheckUnique*/false)>(tc_move_if_owned(rng), tc_move_if_owned(pred));
}
template< typename RangeReturn, typename Rng, typename Pred = tc::identity >
[[nodiscard]] constexpr decltype(auto) find_unique_if(Rng&& rng, Pred&& pred = Pred()) MAYTHROW {
return find_first_if_detail::find_first_if<RangeReturn IF_TC_CHECKS(, /*c_bCheckUnique*/true)>(tc_move_if_owned(rng), tc_move_if_owned(pred));
}
template< typename RangeReturn, typename Rng, typename Pred = tc::identity >
[[nodiscard]] constexpr decltype(auto) find_last_if(Rng&& rng, Pred pred = Pred()) MAYTHROW {
if constexpr( tc::bidirectional_range<Rng> && tc::common_range<Rng> ) {
auto const itBegin=tc::begin(rng);
for( auto it=tc::end(rng); it!=itBegin; ) {
--it;
if constexpr(std::same_as<Pred, tc::constexpr_function<true>>) { // tc::back
return RangeReturn::pack_element(tc_move(it), tc_move_if_owned(rng));
} else {
decltype(auto) ref = *it;
if (tc::explicit_cast<bool>(tc_invoke(pred, tc::as_const(ref)))) {
return RangeReturn::pack_element(tc_move(it), tc_move_if_owned(rng), tc_move_if_owned(ref));
}
}
}
} else {
auto const itEnd=tc::end(rng);
for( auto it=tc::begin(rng); it!=itEnd; ++it ) {
std::array<tc::storage_for_without_dtor<tc::iterator_cache<decltype(it)>>, 2> aic; // tc::storage_for was too slow in debug builds
int iFound = 0;
aic[iFound].ctor(it);
tc_scope_exit { aic[iFound].dtor(); }; //iFound captured by reference
if (tc::explicit_cast<bool>(tc_invoke(pred, tc::as_const(**aic[iFound])))) {
for (;;) {
++it;
if (itEnd==it) break;
aic[1 - iFound].ctor(it);
tc_scope_exit { aic[1 - iFound].dtor(); };
if (tc_invoke(pred, tc::as_const(**aic[1 - iFound]))) {
iFound = 1 - iFound;
}
}
return RangeReturn::pack_element(
tc_move_always(*aic[iFound]).m_it_(), // pack_element must not take iterator by value
tc_move_if_owned(rng),
*tc_move_always(*aic[iFound])
);
}
}
}
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
}
namespace no_adl {
BOOST_MPL_HAS_XXX_TRAIT_DEF(key_type)
}
using no_adl::has_key_type;
namespace find_first_or_unique_default {
template< typename RangeReturn, IF_TC_CHECKS(bool c_bCheckUnique,) typename Rng, typename T >
[[nodiscard]] constexpr decltype(auto) find_first_or_unique_impl(std::type_identity<RangeReturn>, IF_TC_CHECKS(tc::constant<c_bCheckUnique>,) Rng&& rng, T const& t) MAYTHROW {
static_assert(
!tc::has_key_type<std::remove_cvref_t<Rng>>::value,
"Do you want to use tc::cont_find?"
);
return find_first_if_detail::find_first_if<RangeReturn IF_TC_CHECKS(, c_bCheckUnique)>(tc_move_if_owned(rng), [&](auto const& _) MAYTHROW { return tc::equal_to(_, t); });
}
}
DEFINE_TMPL_FUNC_WITH_CUSTOMIZATIONS(find_first_or_unique)
template< typename RangeReturn, typename Rng, typename T >
[[nodiscard]] constexpr decltype(auto) find_unique(Rng&& rng, T&& t) MAYTHROW {
return find_first_or_unique(std::type_identity<RangeReturn>(), IF_TC_CHECKS(tc::constant<true>(),) tc_move_if_owned(rng), tc_move_if_owned(t));
}
template< typename RangeReturn, typename Rng, typename T >
[[nodiscard]] constexpr decltype(auto) find_first(Rng&& rng, T&& t) MAYTHROW {
return find_first_or_unique(std::type_identity<RangeReturn>(), IF_TC_CHECKS(tc::constant<false>(),) tc_move_if_owned(rng), tc_move_if_owned(t));
}
template< typename RangeReturn, typename Rng, typename T >
[[nodiscard]] constexpr decltype(auto) find_last(Rng&& rng, T const& t) noexcept {
return tc::find_last_if<RangeReturn>( tc_move_if_owned(rng), [&](auto const& _) noexcept { return tc::equal_to(_, t); } );
}
}
================================================
FILE: tc/algorithm/find_closest_if.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "element.h"
namespace tc {
template< typename Rng, typename It, typename Func >
auto for_each_iterator_pair_outwards(Rng&& rng, It itOrigin, bool bSkipSelf, Func func) noexcept
-> tc::common_type_t<decltype(tc::continue_if_not_break(func, std::declval<tc::span<It> const&>())), tc::constant<tc::continue_>>
{
std::array<It, 2> const aitLimit = { tc::begin(rng), tc::end(rng) };
std::array<It, 2> ait = { itOrigin, itOrigin };
if (!bSkipSelf) {
_ASSERT(tc::back(aitLimit) != tc::back(ait));
tc_return_if_break(tc::continue_if_not_break(func, tc::begin_next<tc::return_take>(tc::as_const(ait))))
++tc::back(ait);
} else if(tc::back(aitLimit) != tc::back(ait)) {
++tc::back(ait);
}
for (;;) {
if (tc::front(aitLimit) == tc::front(ait)) {
for (; tc::back(ait) != tc::back(aitLimit); ++tc::back(ait)) {
tc_return_if_break(tc::continue_if_not_break(func, tc::begin_next<tc::return_drop>(tc::as_const(ait))))
}
return tc::constant<tc::continue_>();
}
if (tc::back(aitLimit) == tc::back(ait)) {
while (tc::front(ait) != tc::front(aitLimit)) {
--tc::front(ait);
tc_return_if_break(tc::continue_if_not_break(func, tc::begin_next<tc::return_take>(tc::as_const(ait))))
}
return tc::constant<tc::continue_>();
}
--tc::front(ait);
tc_return_if_break(tc::continue_if_not_break(func, tc::as_const(ait)))
++tc::back(ait);
}
}
template < typename RangeReturn, typename Rng, typename It, typename Pred = tc::identity>
[[nodiscard]] constexpr decltype(auto) find_closest_if(Rng&& rng, It it, bool const bSkipSelf, Pred pred = Pred()) noexcept {
tc::storage_for<tc::iterator_cache<It>> oitc;
if (tc::break_ == tc::for_each_iterator_pair_outwards(rng, tc_move(it), bSkipSelf, [&](auto const& rngit) noexcept {
return tc::for_each(rngit, [&](auto const& it) noexcept {
oitc.ctor(it);
if (tc::explicit_cast<bool>(tc_invoke(pred, tc::as_const(**oitc)))) { return tc::break_; }
oitc.dtor();
return tc::continue_;
});
})) {
tc_scope_exit { oitc.dtor(); };
return RangeReturn::pack_element(oitc->m_it_(), tc_move_if_owned(rng), **tc_move(oitc));
} else {
return RangeReturn::pack_no_element(tc_move_if_owned(rng));
}
}
template < typename RangeReturn, typename Rng, typename Index, typename Pred = tc::identity>
[[nodiscard]] decltype(auto) find_closest_if_with_index(Rng&& rng, Index&& n, bool const bSkipSelf, Pred&& pred = Pred()) noexcept {
return find_closest_if<RangeReturn>(tc_move_if_owned(rng), tc::begin_next<tc::return_border>(rng, tc_move_if_owned(n)), bSkipSelf, tc_move_if_owned(pred));
}
}
================================================
FILE: tc/algorithm/find_closest_if.t.cpp
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#include "find_closest_if.h"
#include "../unittest.h"
UNITTESTDEF(find_closest_if) {
struct IntCompareOnce final : boost::noncopyable {
IntCompareOnce(int n) noexcept :m_n(n) { }
bool operator==(int const n) const& noexcept {
_ASSERT( tc::change(m_bCompared, true) );
return m_n==n;
}
private:
int m_n;
bool mutable m_bCompared = false;
};
tc_static_auto_constexpr_lambda(find) = [](auto const& rngn, int const iStart, int const nTarget, int const nComparisonsMax) noexcept {
int nComparisons = 0;
return tc::find_closest_if_with_index<tc::return_element_index_or_none>(rngn, iStart, /*bSkipSelf*/false, [&](IntCompareOnce const& n) noexcept {
_ASSERT(++nComparisons<=nComparisonsMax);
return n==nTarget;
});
};
for (int iStart = 0; iStart < 4; ++iStart) {
for (int nTarget = -1; nTarget < 4; ++nTarget) {
int nComparisonsMax = -1==nTarget ? 5 : nTarget<iStart ? 2*(iStart-nTarget) : 1+2*(nTarget-iStart);
_ASSERTEQUAL(find(tc::make_array<IntCompareOnce>(tc::aggregate_tag, 0, 1, 2, 3, 4), iStart, nTarget, nComparisonsMax), -1==nTarget ? std::nullopt : std::make_optional(nTarget));
}
}
}
================================================
FILE: tc/algorithm/for_each.h
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#pragma once
#include "../base/assert_defs.h"
#include "../base/utility.h"
#include "../range/index_range.h"
#include "../range/meta.h"
#include "../tuple.h"
#include "../base/modified.h"
#include "break_or_continue.h"
namespace tc {
namespace no_adl {
template<typename... T>
struct common_type_break_or_continue;
template<>
struct common_type_break_or_continue<> final {
using type = tc::constant<tc::continue_>;
};
template<typename... T>
struct common_type_break_or_continue<tc::constant<tc::continue_>, T...> {
using type = typename common_type_break_or_continue<T...>::type;
};
template<typename... T>
struct common_type_break_or_continue<tc::constant<tc::break_>, T...> {
using type = tc::constant<tc::break_>;
};
template<typename... T>
struct common_type_break_or_continue<tc::break_or_continue, T...> {
using type = std::conditional_t<
std::is_same<tc::constant<tc::break_>, typename common_type_break_or_continue<T...>::type>::value,
tc::constant<tc::break_>,
tc::break_or_continue
>;
};
}
template<typename... T>
using common_type_break_or_continue_t = typename no_adl::common_type_break_or_continue<T...>::type;
template<typename Sink, typename Rng>
concept has_mem_fn_chunk = requires { std::declval<Sink>().chunk(std::declval<Rng>()); };
DEFINE_MEM_FN(chunk);
namespace void_generator_type_check_no_adl {
template<typename BreakOrContinue, tc::break_or_continue>
struct check_sink_result;
template<typename BreakOrContinue>
struct check_sink_result<BreakOrContinue, tc::continue_> {
static_assert(
!std::is_same<BreakOrContinue, tc::break_or_continue>::value &&
!std::is_same<BreakOrContinue, tc::constant<tc::break_>>::value,
"Functor may return break_, but range does not support it."
);
};
template<typename BreakOrContinue>
struct check_sink_result<BreakOrContinue, tc::break_> {
static_assert(
std::is_same<BreakOrContinue, tc::constant<tc::break_>>::value,
"Functor does not always break, but range does (broken range implementation)."
);
};
template<tc::break_or_continue boc, typename Sink>
struct verify_sink_result_impl final : Sink {
static_assert(tc::decayed<Sink>);
using guaranteed_break_or_continue = tc::constant<boc>;
template<typename... Args, typename R = decltype(std::declval<Sink const&>()(std::declval<Args>()...))>
constexpr tc::constant<boc> operator()(Args&&... args) const& noexcept(noexcept(
tc::base_cast<Sink>(*this)(std::declval<Args&&>()...)
)) {
check_sink_result<R, boc>();
tc::base_cast<Sink>(*this)(tc_move_if_owned(args)...); // MAYTHROW
return {};
}
template<typename Rng> requires tc::has_mem_fn_chunk<Sink const&, Rng>
constexpr tc::constant<boc> chunk(Rng&& rng) const& noexcept(noexcept(
tc::base_cast<Sink>(*this).chunk(tc_move_if_owned(rng))
)) {
check_sink_result<decltype(tc::base_cast<Sink>(*this).chunk(tc_move_if_owned(rng))), boc>();
tc::base_cast<Sink>(*this).chunk(tc_move_if_owned(rng)); // MAYTHROW
return {};
}
};
template<typename Sink>
struct guaranteed_break_or_continue final {
using type = tc::break_or_continue;
};
template<typename Sink> requires requires { typename std::remove_reference_t<Sink>::guaranteed_break_or_continue; }
struct guaranteed_break_or_continue<Sink> final {
using type = typename std::remove_reference_t<Sink>::guaranteed_break_or_continue;
};
}
template<typename Sink>
using guaranteed_break_or_continue_t = typename void_generator_type_check_no_adl::guaranteed_break_or_continue<Sink>::type;
template<typename BreakOrContinue, typename Sink>
requires std::is_same<BreakOrContinue, tc::break_or_continue>::value
|| std::is_same<BreakOrContinue, tc::guaranteed_break_or_continue_t<Sink>>::value
constexpr decltype(auto) verify_sink_result(Sink&& sink) noexcept {
return tc_move_if_owned(sink);
}
template<typename BreakOrContinue, typename Sink>
constexpr void_generator_type_check_no_adl::verify_sink_result_impl<BreakOrContinue::value, tc::decay_t<Sink>> verify_sink_result(Sink&& sink) noexcept {
static_assert( std::is_same<guaranteed_break_or_continue_t<Sink>, tc::break_or_continue>::value, "Mismatch between range and sink result types (broken range implementation)." );
return {tc_move_if_owned(sink)};
}
//-------------------------------------------------------------------------------------------------------------------------
// for_each
namespace for_each_adl {
DEFINE_ADL_TAG_TYPE(adl_tag)
}
template<typename> \
void for_each_impl() noexcept; /*TODO c++20: workaround for c++17*/
namespace for_each_detail {
TC_DEFINE_ENUM(EOverload, eoverload, (CHUNK)(ADL)(INVOKERNG)(ADLTAG)(INDEX)(ITERATOR)(NONE))
namespace no_adl {
template<typename BreakOrContinue>
struct make_break_or_continue;
template<> struct make_break_or_continue<tc::constant<tc::continue_>> { using type = tc::constant<tc::continue_>; };
template<> struct make_break_or_continue<tc::constant<tc::break_>> { using type = tc::constant<tc::break_>; };
template<> struct make_break_or_continue<tc::break_or_continue> { using type = tc::break_or_continue; };
template<> struct make_break_or_continue<void> { using type = tc::constant<tc::continue_>; };
}
template<typename BreakOrContinue>
using make_break_or_continue_t = typename no_adl::make_break_or_continue<BreakOrContinue>::type;
namespace no_adl {
template<typename Rng, typename Sink, int nPriority = 0>
struct select_overload : select_overload<Rng, Sink, nPriority + 1> {};
#pragma push_macro("SELECT_OVERLOAD_IF")
#define SELECT_OVERLOAD_IF(priority, eoverload, requires_clause) \
template<typename Rng, typename Sink> requires_clause \
struct select_overload<Rng, Sink, priority> : tc::constant<eoverload> {};
SELECT_OVERLOAD_IF(0, eoverloadCHUNK, TC_FWD(requires tc::has_mem_fn_chunk<tc::decay_t<Sink> const&, Rng>))
SELECT_OVERLOAD_IF(1, eoverloadADL, TC_FWD(requires requires { for_each_impl(std::declval<Rng>(), std::declval<Sink>()); }))
SELECT_OVERLOAD_IF(1, eoverloadINVOKERNG, TC_FWD(requires requires { typename make_break_or_continue_t<decltype(std::declval<Rng>()(std::declval<Sink>()))>; }))
SELECT_OVERLOAD_IF(2, eoverloadADLTAG, TC_FWD(requires requires { for_each_impl(for_each_adl::adl_tag, std::declval<Rng>(), std::declval<Sink>()); }))
SELECT_OVERLOAD_IF(2, eoverloadINDEX, requires tc::has_index<std::remove_reference_t<Rng>>)
SELECT_OVERLOAD_IF(3, eoverloadITERATOR, requires tc::range_with_iterators<Rng>)
SELECT_OVERLOAD_IF(4, eoverloadNONE, /*none*/)
#pragma pop_macro("SELECT_OVERLOAD_IF")
}
using no_adl::select_overload;
}
template<typename Rng, typename Sink> requires (for_each_detail::eoverloadCHUNK == for_each_detail::select_overload<Rng, Sink>::value)
constexpr auto for_each(Rng&& rng, Sink&& sink) return_MAYTHROW(
tc_internal_continue_if_not_break(/*do we really need that copy?*/tc::as_const(tc::as_lvalue(tc::decay_copy(sink))).chunk(tc_move_if_owned(rng)))
)
template<typename Rng, typename Sink> requires (for_each_detail::eoverloadADL == for_each_detail::select_overload<Rng, Sink>::value)
constexpr auto for_each(Rng&& rng, Sink&& sink) return_MAYTHROW(
for_each_impl(tc_move_if_owned(rng), tc_move_if_owned(sink))
)
template<typename Rng, typename Sink> requires (for_each_detail::eoverloadADLTAG == for_each_detail::select_overload<Rng, Sink>::value)
constexpr auto for_each(Rng&& rng, Sink&& sink) return_MAYTHROW(
for_each_impl(for_each_adl::adl_tag, tc_move_if_owned(rng), tc_move_if_owned(sink))
)
template<typename Rng, typename Sink> requires (for_each_detail::eoverloadINVOKERNG == for_each_detail::select_overload<Rng, Sink>::value)
constexpr auto for_each(Rng&& rng, Sink&& sink) return_MAYTHROW(
tc_internal_continue_if_not_break(tc_move_if_owned(rng)(tc::verify_sink_result<for_each_detail::make_break_or_continue_t<decltype(std::declval<Rng>()(std::declval<Sink>()))>>(tc_move_if_owned(sink))))
)
template<typename Rng, typename Sink, /*not requires because of CWG issue 2369*/std::enable_if_t<for_each_detail::eoverloadINDEX == for_each_detail::select_overload<Rng, Sink>::value>* = nullptr>
constexpr auto for_each(Rng&& rng, Sink&& sink_) noexcept(
noexcept(rng.at_end_index(tc::as_lvalue(tc::decay_copy(rng.begin_index())))) &&
noexcept(rng.increment_index(tc::as_lvalue(rng.begin_index()))) &&
noexcept(tc::continue_if_not_break(std::declval<tc::decay_t<Sink> const&>(), rng.dereference_index(tc::as_lvalue(rng.begin_index()))))
) -> tc::common_type_t<decltype(tc::continue_if_not_break(std::declval<tc::decay_t<Sink> const&>(), rng.dereference_index(tc::as_lvalue(rng.begin_index())))), tc::constant<tc::continue_>> {
tc::decay_t<Sink> const sink = sink_; // do we really need that copy?
for (auto i = rng.begin_index(); !rng.at_end_index(i); rng.increment_index(i)) {
tc_return_if_break(tc::continue_if_not_break(sink, rng.dereference_index(i)))
}
return tc::constant<tc::continue_>();
}
template<typename Rng, typename Sink, /*not requires because of CWG issue 2369*/std::enable_if_t<for_each_detail::eoverloadITERATOR == for_each_detail::select_overload<Rng, Sink>::value>* = nullptr>
constexpr auto for_each(Rng&& rng, Sink&& sink_) noexcept(
noexcept(tc::end(rng)) &&
noexcept(++tc::as_lvalue(tc::begin(rng))) &&
noexcept(tc::continue_if_not_break(std::declval<tc::decay_t<Sink> const&>(), *tc::as_lvalue(tc::begin(rng))))
) -> tc::common_type_t<decltype(tc::continue_if_not_break(std::declval<tc::decay_t<Sink> const&>(), *tc::as_lvalue(tc::begin(rng)))), tc::constant<tc::continue_>> {
tc::decay_t<Sink> const sink = sink_; // do we really need that copy?
auto const itEnd = tc::end(rng);
for(auto it = tc::begin(rng); it!= itEnd; ++it) {
tc_return_if_break(tc::continue_if_not_break(sink, *it))
}
return tc::constant<tc::continue_>();
}
namespace for_each_detail {
template<typename T>
constexpr auto type_value = std::type_identity<T>{};
template<auto Value>
constexpr auto type_value<tc::constant<Value>> = tc::constant<Value>{};
// If the type is a type list, we turn it into a tuple of type values.
// That way `tc::for_each(tc::zip(list1, list2), []<typename U, typename V>(std::type_identity<U>, std::type_identity<V>) { ... })` just works.
template<typename ... T>
constexpr auto type_value<boost::mp11::mp_list<T...>> = tc::make_tuple(type_value<T>...);
template<typename... T, typename Sink, typename R = typename tc::common_type_break_or_continue_t<decltype(tc::continue_if_not_break(std::declval<Sink>(), type_value<T>))...>>
constexpr R for_each_parameter_pack(boost::mp11::mp_list<T...>, Sink const sink) noexcept((noexcept(tc::continue_if_not_break(sink, type_value<T>)) && ...)) {
if constexpr (std::is_same<tc::constant<tc::continue_>, R>::value) {
(tc_invoke(sink, type_value<T>), ...);
return tc::constant<tc::continue_>();
} else {
auto const boc = tc::continue_if(((tc::continue_ == tc_internal_continue_if_not_break(tc_invoke(sink, type_value<T>))) && ...));
if constexpr (std::is_same<tc::constant<tc::break_>, R>::value) {
return tc::constant<tc::break_>();
} else {
return boc;
}
}
}
namespace no_adl {
template<typename Tuple, typename Sink>
struct tuple_index_sink final {
Tuple&& m_tuple;
Sink m_sink;
template<std::size_t I>
constexpr auto operator()(tc::constant<I>) const& return_decltype_MAYTHROW(
tc_invoke(m_sink, tc::get<I>(tc_move_if_owned(m_tuple)))
)
};
}
using no_adl::tuple_index_sink;
}
namespace for_each_adl {
template<typename TIndex, TIndex... Is, typename Sink>
constexpr auto for_each_impl(adl_tag_t, std::integer_sequence<TIndex, Is...>, Sink&& sink) return_decltype_MAYTHROW(
for_each_detail::for_each_parameter_pack(boost::mp11::mp_list<tc::constant<Is>...>(), tc_move_if_owned(sink))
)
template<typename... Ts, typename Sink>
constexpr auto for_each_impl(adl_tag_t, boost::mp11::mp_list<Ts...>, Sink&& sink) return_decltype_MAYTHROW(
for_each_detail::for_each_parameter_pack(boost::mp11::mp_list<Ts...>(), tc_move_if_owned(sink))
)
template<tc::tuple_like Tuple, typename Sink,
typename IndexList = tc::mp_integer_list<std::make_index_sequence<std::tuple_size<std::remove_reference_t<Tuple>>::value>>
TC_REQUIRES_CWG2369_WORKAROUND(!tc::range_with_iterators<Tuple>)
constexpr auto for_each_impl(adl_tag_t, Tuple&& tuple, Sink&& sink) return_decltype_MAYTHROW(
for_each_detail::for_each_parameter_pack(IndexList(), for_each_detail::tuple_index_sink<Tuple, tc::decay_t<Sink>>{tc_move_if_owned(tuple), tc_move_if_owned(sink)})
)
template<typename Rng, typename Sink, /*not requires because of CWG issue 2369*/std::enable_if_t<!std::is_reference<Rng>::value>* = nullptr>
constexpr auto for_each_impl(adl_tag_t, Rng&& rng, Sink&& sink_) noexcept(
noexcept(tc::end(rng)) &&
noexcept(++tc::as_lvalue(tc::begin(rng))) &&
noexcept(tc::continue_if_not_break(std::declval<tc::decay_t<Sink> const&>(), tc_move_always(rng.extract(tc::begin(rng)).value())))
) -> tc::common_type_t<decltype(tc::continue_if_not_break(std::declval<tc::decay_t<Sink> const&>(), tc_move_always(rng.extract(tc::begin(rng)).value()))), tc::constant<tc::continue_>> {
tc::decay_t<Sink> const sink = sink_; // do we really need that copy?
auto it = tc::begin(rng);
auto const itEnd = tc::end(rng);
while (it != itEnd) {
auto itNext = tc_modified(it, ++_);
tc_return_if_break(tc::continue_if_not_break(sink, tc_move_always(rng.extract(it).value())))
it = itNext;
}
return tc::constant<tc::continue_>();
}
}
namespace range_output_tuple_impl::no_adl {
struct fn_range_output final {
template<typename... Ts> boost::mp11::mp_unique<boost::mp11::mp_list<Ts...>> operator()(Ts&&...) const& {
return {}; // unevaluated, not declaration only because of return_invoke workaround
}
};
}
namespace range_output_t_adl {
template<typename... Ts>
auto range_output_t_impl(adl_tag_t, boost::mp11::mp_list<Ts...>)
-> boost::mp11::mp_unique<boost::mp11::mp_list<std::remove_const_t<decltype(for_each_detail::type_value<Ts>)>...>>; // declaration only
template<tc::tuple_like Tuple TC_REQUIRES_CWG2369_WORKAROUND(!tc::range_with_iterators<Tuple>)
auto range_output_t_impl(adl_tag_t, Tuple&& tpl)
-> decltype(tc_apply(range_output_tuple_impl::no_adl::fn_range_output(), std::declval<Tuple>())); // declaration only
}
namespace make_lazy_adl {
template<typename Lazy, typename Sink,
std::enable_if_t<tc::instance<std::remove_reference_t<Lazy>, tc::make_lazy>>* = nullptr
>
constexpr auto for_each_impl(Lazy&& lazy, Sink&& sink) return_decltype_MAYTHROW(
tc::for_each(tc_move_if_owned(lazy)(),tc_move_if_owned(sink))
)
}
TC_HAS_EXPR(for_each, (Rng)(Sink), tc::for_each(std::declval<Rng>(), std::declval<Sink>()))
}
#define TC_RETURN_BREAK_OR_CONTINUE_SEQUENCE_TYPE(state, _, elem) \
decltype(elem),
#define TC_RETURN_BREAK_OR_CONTINUE_SEQUENCE_EVAL(state, _, i, elem) \
tc_return_if_break_impl( \
tc::implicit_cast<BreakOrContinue>(tc::constant<tc::break_>()), \
elem \
)
#define tc_return_break_or_continue_impl(exprseq) \
using BreakOrContinue = tc::common_type_break_or_continue_t< \
BOOST_PP_SEQ_FOR_EACH(TC_RETURN_BREAK_OR_CONTINUE_SEQUENCE_TYPE, _, exprseq) \
tc::constant<tc::continue_> \
>; \
BOOST_PP_SEQ_FOR_EACH_I(TC_RETURN_BREAK_OR_CONTINUE_SEQUENCE_EVAL, _, exprseq) \
if constexpr(!std::same_as<BreakOrContinue, tc::constant<break_>>) { \
return tc::implicit_cast<BreakOrContinue>(tc::constant<tc::continue_>()); \
}
#define tc_return_break_or_continue(exprseq) \
tc_return_break_or_continue_impl(exprseq)
================================================
FILE: tc/algorithm/for_each.t.cpp
================================================
// think-cell public library
//
// Copyright (C) think-cell Software GmbH
//
// 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
#include "../base/assert_defs.h"
#include "../unittest.h"
#include "../base/ref.h"
#include "../range/adjacent_adaptor.h"
#include "../range/ordered_pairs.h"
#include "../container/insert.h"
#include "for_each_xxx.h"
#include <tuple>
STATICASSERTEQUAL(tc_internal_continue_if_not_break(tc::break_), tc::break_);
STATICASSERTEQUAL(tc_internal_continue_if_not_break(tc::continue_), tc::continue_);
STATICASSERTSAME(decltype(tc_internal_continue_if_not_break(tc::break_)), tc::break_or_continue);
STATICASSERTSAME(decltype(tc_internal_continue_if_not_break(tc::continue_)), tc::break_or_continue);
STATICASSERTSAME(decltype(tc_internal_continue_if_not_break(tc::constant<tc::break_>())), tc::constant<tc::break_>);
STATICASSERTSAME(decltype(tc_internal_continue_if_not_break(tc::constant<tc::continue_>())), tc::constant<tc::continue_>);
STATICASSERTSAME(decltype(tc_internal_continue_if_not_break(23)), tc::constant<tc::continue_>);
STATICASSERTSAME(decltype(tc_internal_continue_if_not_break(void())), tc::constant<tc::continue_>);
//---- for_each ---------------------------------------------------------------------------------------------------------------
namespace {
struct all_called_mock final {
all_called_mock() noexcept : m_expect(0), m_index(0), m_break_at(0), m_copyed_or_moved_from(false) {}
all_called_mock(tc::vector<int> const& v, std::size_t break_at = 0, bool expect_break = true) noexcept
: m_expect(v),
m_index(0),
m_break_at((break_at == 0) ? v.size() : break_at),
m_expect_break((break_at != 0) && expect_break),
m_copyed_or_moved_from(false)
{}
all_called_mock(all_called_mock const& copy) noexcept :
m_expect(copy.m_expect),
m_index(copy.m_index),
m_break_at(copy.m_break_at),
m_expect_break(copy.m_expect_break),
m_copyed_or_moved_from(false)
{
copy.m_copyed_or_moved_from = true;
}
all_called_mock(all_called_mock&& move) noexcept :
m_expect(move.m_expect),
m_index(move.m_index),
m_break_at(move.m_break_at),
m_expect_break(move.m_expect_break),
m_copyed_or_moved_from(false)
{
move.m_copyed_or_moved_from = true;
}
~all_called_mock() {
mock_reset();
}
void mock_reset(tc::vector<int> const& v = tc::vector<int>(), std::size_t const break_at = 0, bool expect_break = true) & noexcept {
if(!m_copyed_or_moved_from && !(m_index == tc::min(m_expect.size(), (m_expect_break) ? m_break_at + 1 : m_expect.size()))) {
TEST_OUTPUT( << "unexpectedly terminated before index " << m_index
<< " went to the expected index " << tc::min(m_expect.size(), m_break_at + 1) << '\n');
_ASSERTEQUAL(m_index, tc::min(m_expect.size(), m_break_at + 1));
}
m_index = 0;
m_expect = v;
m_break_at = (break_at == 0) ? v.size() : break_at;
m_expect_break = (break_at != 0) && expect_break;
m_copyed_or_moved_from = false;
}
tc::break_or_continue operator()(int const val) const& noexcept {
if (m_copyed_or_moved_from) {
TEST_OUTPUT(<< "used copyed or moved consumer for real work!\n");
}
if(!(m_index < m_expect.size())) {
TEST_OUTPUT( << "unexpectedly called for index " << m_index
<< " when expect has size " << m_expect.size() << '\n');
_ASSERT(m_index < m_expect.size());
}
if (val != m_expect[m_index]) {
TEST_OUTPUT( << "unexpected value " << val << " at index " << m_index
<< ", should be " << m_expect[m_index] << '\n');
_ASSERTEQUAL(val, m_expect[m_index]);
}
++m_index;
return tc::continue_if(m_index <= m_break_at);
}
private:
tc::vector<int> m_expect;
mutable std::size_t m_index;
std::size_t m_break_at;
bool m_expect_break;
mutable bool m_copyed_or_moved_from; // so t
gitextract_lxw4u0yo/
├── .gitattributes
├── .github/
│ └── workflows/
│ └── main.yml
├── CMakeLists.txt
├── LICENSE_1_0.txt
├── README.md
├── range.example.cpp
└── tc/
├── algorithm/
│ ├── accumulate.h
│ ├── algorithm.h
│ ├── algorithm.t.cpp
│ ├── any_accu.h
│ ├── append.h
│ ├── append.t.cpp
│ ├── best_element.h
│ ├── binary_operators.h
│ ├── break_or_continue.h
│ ├── compare.h
│ ├── element.h
│ ├── element.t.cpp
│ ├── empty.h
│ ├── empty.t.cpp
│ ├── equal.h
│ ├── equal.t.cpp
│ ├── filter_inplace.h
│ ├── find.h
│ ├── find_closest_if.h
│ ├── find_closest_if.t.cpp
│ ├── for_each.h
│ ├── for_each.t.cpp
│ ├── for_each_xxx.h
│ ├── interleave_ranges.h
│ ├── longest_common_prefix.h
│ ├── longest_common_prefix.t.cpp
│ ├── minmax.h
│ ├── partition_iterator.h
│ ├── partition_range.h
│ ├── quantifier.h
│ ├── quantifier.t.cpp
│ ├── restrict_size_decrement.h
│ ├── round.h
│ ├── round.t.cpp
│ ├── size.h
│ ├── size_bounded.h
│ ├── size_linear.h
│ ├── sort_streaming.h
│ └── sort_streaming.t.cpp
├── array.h
├── base/
│ ├── accessors.h
│ ├── as_lvalue.h
│ ├── assert_defs.h
│ ├── bit_cast.h
│ ├── bitfield.h
│ ├── bitfield.t.cpp
│ ├── casts.h
│ ├── casts.t.cpp
│ ├── chained.h
│ ├── change.h
│ ├── conditional.h
│ ├── conditional.t.cpp
│ ├── construction_restrictiveness.h
│ ├── derivable.h
│ ├── empty_chain.h
│ ├── enum.h
│ ├── enum.t.cpp
│ ├── explicit_cast.h
│ ├── explicit_cast_fwd.h
│ ├── functors.h
│ ├── fundamental.h
│ ├── generic_macros.h
│ ├── has_xxx.h
│ ├── inplace.h
│ ├── inside_unwinding.h
│ ├── integer.h
│ ├── invoke.h
│ ├── invoke.t.cpp
│ ├── invoke_with_constant.h
│ ├── large_integer.h
│ ├── modified.h
│ ├── modified.t.cpp
│ ├── move.h
│ ├── noncopyable.h
│ ├── ref.h
│ ├── reference_or_value.h
│ ├── reference_or_value.t.cpp
│ ├── renew.h
│ ├── return_decltype.h
│ ├── rvalue_property.h
│ ├── rvalue_property.t.cpp
│ ├── safe_comparison.h
│ ├── safe_comparison.t.cpp
│ ├── scope.h
│ ├── static_polymorphism.h
│ ├── string_template_param.h
│ ├── tag_type.h
│ ├── template_func.h
│ ├── temporary.h
│ ├── temporary.t.cpp
│ ├── track_instance.h
│ ├── track_instance.t.cpp
│ ├── trivial_functors.h
│ ├── trivial_functors.t.cpp
│ ├── type_list.h
│ ├── type_list.t.cpp
│ ├── type_traits.h
│ ├── type_traits.t.cpp
│ ├── type_traits_fwd.h
│ ├── utility.h
│ └── utility.t.cpp
├── compat.t.cpp
├── const.t.cpp
├── container/
│ ├── cont_assign.h
│ ├── cont_assign.t.cpp
│ ├── cont_reserve.h
│ ├── container.h
│ ├── container_traits.h
│ ├── insert.h
│ └── string.h
├── create.t.cpp
├── dense_map.h
├── dense_map.natvis
├── dense_map.t.cpp
├── enumset.h
├── interval.h
├── interval.t.cpp
├── interval_types.h
├── optional.h
├── optional.t.cpp
├── range/
│ ├── adjacent_adaptor.h
│ ├── cartesian_product_adaptor.h
│ ├── concat_adaptor.h
│ ├── concat_adaptor.t.cpp
│ ├── conditional_range.h
│ ├── conditional_range.t.cpp
│ ├── empty_range.h
│ ├── filter_adaptor.h
│ ├── index_iterator.h
│ ├── index_range.h
│ ├── intersection_adaptor.h
│ ├── intersection_adaptor.t.cpp
│ ├── iota_range.h
│ ├── iterator_cache.h
│ ├── iterator_facade.h
│ ├── join_adaptor.h
│ ├── join_framed_adaptor.h
│ ├── literal_range.h
│ ├── literal_range.t.cpp
│ ├── make_range.h
│ ├── merge_range.h
│ ├── merge_ranges.h
│ ├── merge_ranges.t.cpp
│ ├── meta.h
│ ├── ordered_pairs.h
│ ├── partial_sum.h
│ ├── range.t.cpp
│ ├── range_adaptor.h
│ ├── range_return.h
│ ├── repeat_n.h
│ ├── reverse_adaptor.h
│ ├── reverse_adaptor.t.cpp
│ ├── sparse_adaptor.h
│ ├── sparse_adaptor.t.cpp
│ ├── subrange.h
│ ├── subrange.t.cpp
│ ├── take_while.h
│ ├── take_while.t.cpp
│ ├── transform.h
│ ├── transform.t.cpp
│ ├── transform_adaptor.h
│ ├── union_adaptor.h
│ ├── unique_range_adaptor.h
│ ├── zip_range.h
│ └── zip_range.t.cpp
├── restricted_enum.h
├── restricted_enum.t.cpp
├── static_vector.h
├── storage_for.h
├── string/
│ ├── ascii.h
│ ├── char.h
│ ├── char.t.cpp
│ ├── convert_enc.h
│ ├── convert_enc.t.cpp
│ ├── format.h
│ ├── jsonparser.h
│ ├── jsonparser.t.cpp
│ ├── make_c_str.h
│ ├── make_c_str.t.cpp
│ ├── named.h
│ ├── parserbase.h
│ ├── spirit/
│ │ ├── support/
│ │ │ ├── assert_msg.hpp
│ │ │ ├── char_encoding/
│ │ │ │ ├── ascii.hpp
│ │ │ │ ├── iso8859_1.hpp
│ │ │ │ ├── standard.hpp
│ │ │ │ ├── standard_wide.hpp
│ │ │ │ ├── unicode/
│ │ │ │ │ ├── category_table.hpp
│ │ │ │ │ ├── lowercase_table.hpp
│ │ │ │ │ ├── query.hpp
│ │ │ │ │ ├── script_table.hpp
│ │ │ │ │ └── uppercase_table.hpp
│ │ │ │ └── unicode.hpp
│ │ │ └── char_set/
│ │ │ ├── basic_chset.hpp
│ │ │ ├── range.hpp
│ │ │ ├── range_functions.hpp
│ │ │ ├── range_run.hpp
│ │ │ └── range_run_impl.hpp
│ │ ├── unittest/
│ │ │ ├── actions.t.cpp
│ │ │ ├── alternative.t.cpp
│ │ │ ├── and_predicate.t.cpp
│ │ │ ├── attr.t.cpp
│ │ │ ├── attribute_type_check.t.cpp
│ │ │ ├── binary.t.cpp
│ │ │ ├── bool.hpp
│ │ │ ├── bool.t.cpp
│ │ │ ├── char1.t.cpp
│ │ │ ├── char_class.t.cpp
│ │ │ ├── confix.t.cpp
│ │ │ ├── container_support.t.cpp
│ │ │ ├── difference.t.cpp
│ │ │ ├── eoi.t.cpp
│ │ │ ├── eol.t.cpp
│ │ │ ├── eps.t.cpp
│ │ │ ├── error_handler.t.cpp
│ │ │ ├── expect.t.cpp
│ │ │ ├── extract_int.t.cpp
│ │ │ ├── fusion_map.t.cpp
│ │ │ ├── grammar.hpp
│ │ │ ├── grammar.t.cpp
│ │ │ ├── grammar_linker.t.cpp
│ │ │ ├── int.hpp
│ │ │ ├── int1.t.cpp
│ │ │ ├── iterator_check.t.cpp
│ │ │ ├── kleene.t.cpp
│ │ │ ├── lexeme.t.cpp
│ │ │ ├── list.t.cpp
│ │ │ ├── lit.t.cpp
│ │ │ ├── lit1.t.cpp
│ │ │ ├── lit2.t.cpp
│ │ │ ├── matches.t.cpp
│ │ │ ├── no_case.t.cpp
│ │ │ ├── no_skip.t.cpp
│ │ │ ├── not_predicate.t.cpp
│ │ │ ├── omit.t.cpp
│ │ │ ├── optional_x3.t.cpp
│ │ │ ├── plus.t.cpp
│ │ │ ├── raw.t.cpp
│ │ │ ├── real.hpp
│ │ │ ├── real1.t.cpp
│ │ │ ├── real2.t.cpp
│ │ │ ├── real3.t.cpp
│ │ │ ├── real4.t.cpp
│ │ │ ├── repeat.t.cpp
│ │ │ ├── rule1.t.cpp
│ │ │ ├── rule2.t.cpp
│ │ │ ├── rule3.t.cpp
│ │ │ ├── rule4.t.cpp
│ │ │ ├── rule_separate_tu.t.cpp
│ │ │ ├── rule_separate_tu_grammar.hpp
│ │ │ ├── rule_separate_tu_grammar.t.cpp
│ │ │ ├── seek.t.cpp
│ │ │ ├── sequence.t.cpp
│ │ │ ├── skip.t.cpp
│ │ │ ├── symbols1.t.cpp
│ │ │ ├── symbols2.t.cpp
│ │ │ ├── symbols3.t.cpp
│ │ │ ├── test.hpp
│ │ │ ├── to_utf8.t.cpp
│ │ │ ├── tst.t.cpp
│ │ │ ├── uint.hpp
│ │ │ ├── uint1.t.cpp
│ │ │ ├── uint_radix.hpp
│ │ │ ├── uint_radix.t.cpp
│ │ │ ├── unused_type.t.cpp
│ │ │ ├── utils.hpp
│ │ │ ├── with.t.cpp
│ │ │ └── x3_variant.t.cpp
│ │ ├── x3/
│ │ │ ├── auxiliary/
│ │ │ │ ├── attr.hpp
│ │ │ │ ├── eoi.hpp
│ │ │ │ ├── eol.hpp
│ │ │ │ ├── eps.hpp
│ │ │ │ └── guard.hpp
│ │ │ ├── auxiliary.hpp
│ │ │ ├── binary/
│ │ │ │ └── binary.hpp
│ │ │ ├── binary.hpp
│ │ │ ├── char/
│ │ │ │ ├── any_char.hpp
│ │ │ │ ├── char.hpp
│ │ │ │ ├── char_class.hpp
│ │ │ │ ├── char_class_tags.hpp
│ │ │ │ ├── char_parser.hpp
│ │ │ │ ├── char_set.hpp
│ │ │ │ ├── detail/
│ │ │ │ │ └── cast_char.hpp
│ │ │ │ ├── literal_char.hpp
│ │ │ │ ├── negated_char_parser.hpp
│ │ │ │ └── unicode.hpp
│ │ │ ├── char.hpp
│ │ │ ├── core/
│ │ │ │ ├── action.hpp
│ │ │ │ ├── call.hpp
│ │ │ │ ├── detail/
│ │ │ │ │ └── parse_into_container.hpp
│ │ │ │ ├── parse.hpp
│ │ │ │ ├── parser.hpp
│ │ │ │ ├── proxy.hpp
│ │ │ │ └── skip_over.hpp
│ │ │ ├── core.hpp
│ │ │ ├── directive/
│ │ │ │ ├── confix.hpp
│ │ │ │ ├── expect.hpp
│ │ │ │ ├── lexeme.hpp
│ │ │ │ ├── matches.hpp
│ │ │ │ ├── no_case.hpp
│ │ │ │ ├── no_skip.hpp
│ │ │ │ ├── omit.hpp
│ │ │ │ ├── raw.hpp
│ │ │ │ ├── repeat.hpp
│ │ │ │ ├── seek.hpp
│ │ │ │ ├── skip.hpp
│ │ │ │ └── with.hpp
│ │ │ ├── directive.hpp
│ │ │ ├── nonterminal/
│ │ │ │ ├── debug_handler_state.hpp
│ │ │ │ ├── detail/
│ │ │ │ │ ├── rule.hpp
│ │ │ │ │ └── transform_attribute.hpp
│ │ │ │ ├── rule.hpp
│ │ │ │ └── simple_trace.hpp
│ │ │ ├── nonterminal.hpp
│ │ │ ├── numeric/
│ │ │ │ ├── bool.hpp
│ │ │ │ ├── bool_policies.hpp
│ │ │ │ ├── int.hpp
│ │ │ │ ├── real.hpp
│ │ │ │ ├── real_policies.hpp
│ │ │ │ └── uint.hpp
│ │ │ ├── numeric.hpp
│ │ │ ├── operator/
│ │ │ │ ├── alternative.hpp
│ │ │ │ ├── and_predicate.hpp
│ │ │ │ ├── detail/
│ │ │ │ │ ├── alternative.hpp
│ │ │ │ │ └── sequence.hpp
│ │ │ │ ├── difference.hpp
│ │ │ │ ├── kleene.hpp
│ │ │ │ ├── list.hpp
│ │ │ │ ├── not_predicate.hpp
│ │ │ │ ├── optional.hpp
│ │ │ │ ├── plus.hpp
│ │ │ │ └── sequence.hpp
│ │ │ ├── operator.hpp
│ │ │ ├── string/
│ │ │ │ ├── detail/
│ │ │ │ │ ├── string_parse.hpp
│ │ │ │ │ └── tst.hpp
│ │ │ │ ├── literal_string.hpp
│ │ │ │ ├── symbols.hpp
│ │ │ │ ├── tst.hpp
│ │ │ │ └── tst_map.hpp
│ │ │ ├── string.hpp
│ │ │ ├── support/
│ │ │ │ ├── ast/
│ │ │ │ │ ├── position_tagged.hpp
│ │ │ │ │ └── variant.hpp
│ │ │ │ ├── context.hpp
│ │ │ │ ├── no_case.hpp
│ │ │ │ ├── numeric_utils/
│ │ │ │ │ ├── detail/
│ │ │ │ │ │ └── extract_int.hpp
│ │ │ │ │ ├── extract_int.hpp
│ │ │ │ │ ├── extract_real.hpp
│ │ │ │ │ └── pow10.hpp
│ │ │ │ ├── subcontext.hpp
│ │ │ │ ├── traits/
│ │ │ │ │ ├── attribute_category.hpp
│ │ │ │ │ ├── attribute_of.hpp
│ │ │ │ │ ├── attribute_of_binary.hpp
│ │ │ │ │ ├── attribute_type.hpp
│ │ │ │ │ ├── container_traits.hpp
│ │ │ │ │ ├── handles_container.hpp
│ │ │ │ │ ├── has_attribute.hpp
│ │ │ │ │ ├── is_range.hpp
│ │ │ │ │ ├── is_substitute.hpp
│ │ │ │ │ ├── is_variant.hpp
│ │ │ │ │ ├── move_to.hpp
│ │ │ │ │ ├── numeric_traits.hpp
│ │ │ │ │ ├── optional_traits.hpp
│ │ │ │ │ ├── print_attribute.hpp
│ │ │ │ │ ├── print_token.hpp
│ │ │ │ │ ├── pseudo_attribute.hpp
│ │ │ │ │ ├── string_traits.hpp
│ │ │ │ │ ├── transform_attribute.hpp
│ │ │ │ │ ├── tuple_traits.hpp
│ │ │ │ │ ├── variant_find_substitute.hpp
│ │ │ │ │ └── variant_has_substitute.hpp
│ │ │ │ ├── unused.hpp
│ │ │ │ └── utility/
│ │ │ │ ├── annotate_on_success.hpp
│ │ │ │ ├── error_reporting.hpp
│ │ │ │ ├── is_callable.hpp
│ │ │ │ ├── lambda_visitor.hpp
│ │ │ │ ├── sfinae.hpp
│ │ │ │ └── utf8.hpp
│ │ │ └── version.hpp
│ │ └── x3.hpp
│ ├── spirit.h
│ ├── spirit_algorithm.h
│ ├── xmlparser.h
│ ├── xmlparser.t.cpp
│ └── xmltransform.h
├── tuple.h
├── unittest.h
├── variant.h
└── variant.t.cpp
Showing preview only (490K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3165 symbols across 363 files)
FILE: range.example.cpp
function print (line 22) | void print(Args&&... args) noexcept {
function basic (line 27) | void basic () {
type generator_range (line 41) | struct generator_range {
function ex_generator_range (line 51) | void ex_generator_range () {
type generator_range_break (line 60) | struct generator_range_break {
function ex_generator_range_break (line 72) | void ex_generator_range_break () {
function stacked_filters (line 81) | void stacked_filters() {
function main (line 97) | int main() {
FILE: tc/algorithm/accumulate.h
function namespace (line 15) | namespace tc {
function T (line 36) | [[nodiscard]] constexpr T accumulate(Rng&& rng, T t, AccuOp accuop) MAYT...
function namespace (line 41) | namespace no_adl {
function std (line 64) | [[nodiscard]] constexpr std::optional<T> accumulate_with_front(Rng&& rng...
function MAYTHROW (line 72) | [[nodiscard]] constexpr auto accumulate_with_front(Rng&& rng, AccuOp&& a...
FILE: tc/algorithm/algorithm.h
function namespace (line 67) | namespace tc {
function namespace (line 194) | namespace no_adl {
function noexcept (line 333) | [[nodiscard]] auto ordered_unique_range(Rng&& rng, Less&& less = Less())...
function noexcept (line 361) | [[nodiscard]] auto sort_inplace_unique_range(Rng&& rng, Less&& less = Le...
function Char (line 561) | constexpr Char const* take_null_terminated(Char const (&ach)[N]) noexcept {
function namespace (line 567) | namespace get_buffer_detail {
function noexcept (line 828) | constexpr auto constexpr_sort_unique(Rng&& rng, Less&& less=Less()) noex...
function namespace (line 835) | namespace find_first_or_unique_adl {
function noexcept (line 965) | auto interleave_may_remove_current(RngA&& rngA, RngB&& rngB, Comp comp, ...
function namespace (line 973) | namespace interleave_2_detail {
function namespace (line 1093) | namespace no_adl {
function FindBest (line 1127) | bool FindBest(bool* const) const& {
function break_or_continue (line 1154) | break_or_continue operator()(Func func, std::index_sequence<I...>, PairI...
function break_or_continue (line 1172) | break_or_continue interleave_n(Compare&& compare, Func&& func, Rng&&... ...
function noexcept (line 1184) | [[nodiscard]] auto common_prefix(RngRng&& rngrng) noexcept {
function noexcept (line 1196) | [[nodiscard]] auto make_variant_range_filter(Rng&& rng) noexcept {
FILE: tc/algorithm/algorithm.t.cpp
function static_tests (line 21) | [[maybe_unused]] void static_tests() noexcept {
function UNITTESTDEF (line 31) | UNITTESTDEF( sort_accumulate_each_unique_range_2 ) {
function UNITTESTDEF (line 53) | UNITTESTDEF(filter_no_self_assignment_of_rvalues) {
function UNITTESTDEF (line 76) | UNITTESTDEF( trim_leftright_if ) {
function UNITTESTDEF (line 96) | UNITTESTDEF( is_sorted ) {
function UNITTESTDEF (line 131) | UNITTESTDEF( make_vector_on_r_vector_is_identity ) {
function UNITTESTDEF (line 139) | UNITTESTDEF(is_strictly_sorted){
function UNITTESTDEF (line 145) | UNITTESTDEF(remove_inplace_parser) {
function UNITTESTDEF (line 151) | UNITTESTDEF(Naryinterleave) {
function UNITTESTDEF (line 191) | UNITTESTDEF(NaryinterleaveBreak) {
function UNITTESTDEF (line 233) | UNITTESTDEF(InterleaveRanges) {
function UNITTESTDEF (line 284) | UNITTESTDEF(plurality_element_test) {
function UNITTESTDEF (line 300) | UNITTESTDEF(sort_test) {
function UNITTESTDEF (line 312) | UNITTESTDEF(constexpr_sort_test) {
FILE: tc/algorithm/any_accu.h
function namespace (line 13) | namespace tc {
FILE: tc/algorithm/append.h
function namespace (line 29) | namespace tc {
function namespace (line 133) | namespace appender_default {
function else (line 160) | else if constexpr( tc::random_access_range<Cont> || has_mem_fn_reserve<C...
function FirstAppendedElement (line 177) | auto const FirstAppendedElement = [&]() noexcept {
function append (line 193) | constexpr decltype(auto) append(Cont&& cont, Rng&&... rng) MAYTHROW {
function namespace (line 197) | namespace no_adl {
function namespace (line 227) | namespace explicit_convert_to_container_detail {
function namespace (line 238) | namespace explicit_convert_adl {
function MAYTHROW (line 264) | [[nodiscard]] auto make_vector(Rng&&... rng) MAYTHROW {
function MAYTHROW (line 270) | [[nodiscard]] auto make_str(Rng&&... rng) MAYTHROW {
function MAYTHROW (line 276) | [[nodiscard]] auto make_str(Rng&&... rng) MAYTHROW {
function MAYTHROW (line 282) | [[nodiscard]] auto make_unique_unordered_set(Rng&& rng) MAYTHROW {
function MAYTHROW (line 289) | [[nodiscard]] auto make_unique_unordered_set(Rng&& rng) MAYTHROW {
function MAYTHROW (line 294) | [[nodiscard]] auto make_unordered_set(Rng&& rng) MAYTHROW {
function MAYTHROW (line 301) | [[nodiscard]] auto make_unordered_set(Rng&& rng) MAYTHROW {
FILE: tc/algorithm/append.t.cpp
function UNITTESTDEF (line 25) | UNITTESTDEF(nonappendable) {
function UNITTESTDEF (line 33) | UNITTESTDEF(append_on_dtor) {
FILE: tc/algorithm/best_element.h
function namespace (line 17) | namespace tc {
function best_element (line 64) | [[nodiscard]] constexpr decltype(auto) best_element(Better&& better, Rng...
function min_element (line 69) | [[nodiscard]] constexpr decltype(auto) min_element(Rng&& rng, Projection...
function max_element (line 74) | [[nodiscard]] constexpr decltype(auto) max_element(Rng&& rng, Projection...
function closest_element (line 79) | [[nodiscard]] constexpr decltype(auto) closest_element(Rng&& rng, T cons...
FILE: tc/algorithm/binary_operators.h
function namespace (line 20) | namespace tc {
function namespace (line 144) | namespace binary_operator_conversions {
function namespace (line 181) | namespace scalar_binary_op_detail::no_adl {
FILE: tc/algorithm/break_or_continue.h
function namespace (line 19) | namespace tc {
function namespace (line 51) | namespace continue_if_not_break_adl {
function noexcept (line 163) | move_only_function_base(std::nullptr_t) noexcept {}
function explicit (line 187) | explicit operator bool() const& noexcept { tc_return_cast(m_func); }
function friend (line 193) | friend decltype(auto) debug_output_impl(move_only_function_base const& s...
function cyclic_improve_impl (line 218) | inline bool cyclic_improve_impl(int const n, int& nSkipRule) noexcept {
FILE: tc/algorithm/compare.h
function namespace (line 31) | namespace tc {
function namespace (line 41) | namespace tc {
function noexcept (line 200) | [[nodiscard]] constexpr auto lexicographical_compare_3way(Rng const& rng...
function namespace (line 218) | namespace lexicographical_compare_3way_detail {
function noexcept (line 258) | [[nodiscard]] constexpr auto lexicographical_compare_3way_noprefix(Lhs c...
function noexcept (line 262) | [[nodiscard]] constexpr auto lexicographical_compare_3way_prefixequivale...
function namespace (line 272) | namespace std { // ADL
function noexcept (line 304) | noexcept
function namespace (line 341) | namespace tc {
FILE: tc/algorithm/element.h
function namespace (line 14) | namespace tc {
function namespace (line 196) | namespace no_adl { \
FILE: tc/algorithm/element.t.cpp
function UNITTESTDEF (line 14) | UNITTESTDEF( front ) {
FILE: tc/algorithm/empty.h
function namespace (line 15) | namespace tc {
FILE: tc/algorithm/empty.t.cpp
type empty_generator (line 16) | struct empty_generator {
type non_empty_generator (line 20) | struct non_empty_generator {
function UNITTESTDEF (line 24) | UNITTESTDEF( empty_range ) {
FILE: tc/algorithm/equal.h
function namespace (line 25) | namespace tc{
function starts_with (line 104) | [[nodiscard]] constexpr decltype(auto) starts_with(LRng&& lrng, RRng con...
function starts_with (line 113) | [[nodiscard]] constexpr decltype(auto) starts_with(LRng&& lrng, RRng con...
function equal (line 120) | [[nodiscard]] constexpr bool equal(LRng const& lrng, RRng&& rrng, Pred&&...
function ends_with (line 161) | constexpr decltype(auto) ends_with(LRng&& lrng, RRng const& rrng, Pred p...
function namespace (line 175) | namespace value_equal_to_detail {
function value_equal_to (line 183) | [[nodiscard]] constexpr bool value_equal_to(Lhs const& lhs, Rhs const& r...
FILE: tc/algorithm/equal.t.cpp
function UNITTESTDEF (line 15) | UNITTESTDEF( equal_vec_int ) {
FILE: tc/algorithm/filter_inplace.h
function namespace (line 18) | namespace tc {
function pop_back (line 76) | constexpr void pop_back() & noexcept requires (!has_mem_fn_hash_function...
function m_contInput (line 93) | constexpr range_filter(Cont& cont, tc::iterator_t<Cont> const& itStart) ...
function keep (line 103) | constexpr void keep(tc::iterator_t<Cont> it) & noexcept {
function keep (line 147) | constexpr void keep(tc::iterator_t<Cont> it) & noexcept {
function end (line 164) | constexpr auto begin() const& noexcept {
FILE: tc/algorithm/find.h
function namespace (line 20) | namespace tc {
function namespace (line 150) | namespace no_adl {
function namespace (line 155) | namespace find_first_or_unique_default {
function find_unique (line 168) | constexpr decltype(auto) find_unique(Rng&& rng, T&& t) MAYTHROW {
function find_first (line 173) | [[nodiscard]] constexpr decltype(auto) find_first(Rng&& rng, T&& t) MAYT...
function find_last (line 178) | [[nodiscard]] constexpr decltype(auto) find_last(Rng&& rng, T const& t) ...
FILE: tc/algorithm/find_closest_if.h
function find_closest_if (line 51) | [[nodiscard]] constexpr decltype(auto) find_closest_if(Rng&& rng, It it,...
function find_closest_if_with_index (line 69) | [[nodiscard]] decltype(auto) find_closest_if_with_index(Rng&& rng, Index...
FILE: tc/algorithm/find_closest_if.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(find_closest_if) {
FILE: tc/algorithm/for_each.h
function namespace (line 23) | namespace no_adl {
function final (line 81) | struct verify_sink_result_impl final : Sink {
function namespace (line 221) | namespace for_each_detail {
FILE: tc/algorithm/for_each.t.cpp
type all_called_mock (line 31) | struct all_called_mock final {
method all_called_mock (line 32) | all_called_mock() noexcept : m_expect(0), m_index(0), m_break_at(0), m...
method all_called_mock (line 33) | all_called_mock(tc::vector<int> const& v, std::size_t break_at = 0, bo...
method all_called_mock (line 40) | all_called_mock(all_called_mock const& copy) noexcept :
method all_called_mock (line 49) | all_called_mock(all_called_mock&& move) noexcept :
method mock_reset (line 62) | void mock_reset(tc::vector<int> const& v = tc::vector<int>(), std::siz...
function foo (line 103) | void foo(int const i) noexcept { g_mock(i); }
function TEST_init_hack (line 196) | TEST_init_hack(tc::vector, int, exp, {1,2,3,4,5,6,7,8,9,10});
function switch_no_default (line 333) | switch_no_default(i) {
function switch_no_default (line 349) | switch_no_default(i) {
function switch_no_default (line 366) | switch_no_default(i) {
FILE: tc/algorithm/for_each_xxx.h
function namespace (line 16) | namespace tc {
FILE: tc/algorithm/interleave_ranges.h
function namespace (line 20) | namespace tc {
function prepare_index (line 116) | constexpr void prepare_index(tc_index& idx) const& noexcept {
FILE: tc/algorithm/longest_common_prefix.h
function namespace (line 13) | namespace tc {
FILE: tc/algorithm/longest_common_prefix.t.cpp
function UNITTESTDEF (line 13) | UNITTESTDEF( longest_common_prefix ) {
FILE: tc/algorithm/minmax.h
function namespace (line 15) | namespace tc {
FILE: tc/algorithm/partition_iterator.h
function namespace (line 31) | namespace adl {
FILE: tc/algorithm/partition_range.h
function namespace (line 14) | namespace tc {
function noexcept (line 39) | [[nodiscard]] decltype(auto) upper_bound(Rng&& rng, Value const& val, So...
function noexcept (line 48) | [[nodiscard]] decltype(auto) equal_range(Rng&& rng, Value const& val, So...
function noexcept (line 54) | [[nodiscard]] decltype(auto) range_in_interval_inclusive(Rng&& rng, tc::...
function noexcept (line 63) | [[nodiscard]] decltype(auto) range_in_interval(Rng&& rng, tc::interval<V...
FILE: tc/algorithm/quantifier.h
function namespace (line 23) | namespace tc {
function namespace (line 85) | namespace no_adl {
type return_all_same_result (line 136) | struct return_all_same_result
function MAYTHROW (line 143) | static constexpr auto fn(Rng&& rng, Equal&& equal) MAYTHROW {
function fn (line 152) | static constexpr decltype(auto) fn(Rng&& rng, Equal&& equal) MAYTHROW {
function noexcept (line 177) | [[nodiscard]] constexpr bool all_same(Rng&& rng, Equal equal = {}) noexc...
FILE: tc/algorithm/quantifier.t.cpp
function UNITTESTDEF (line 14) | UNITTESTDEF( quantifiers ) {
function UNITTESTDEF (line 41) | UNITTESTDEF( all_same ) {
FILE: tc/algorithm/restrict_size_decrement.h
function namespace (line 13) | namespace tc
FILE: tc/algorithm/round.h
function namespace (line 20) | namespace tc {
function noexcept (line 147) | [[nodiscard]] constexpr auto mul(tc::constant<valLhs> lhs, Rhs rhs) noex...
function __clang__ (line 158) | [[nodiscard]] inline constexpr
function fdiv (line 170) | [[nodiscard]] constexpr double fdiv(Num num, Den den) noexcept {
function final (line 174) | struct SRoundFloor final {
function roundFLOOR (line 193) | inline constexpr roundFLOOR{}
function final (line 195) | struct SRoundNearest final {
function roundNEAREST (line 214) | inline constexpr roundNEAREST{}
function final (line 216) | struct SRoundAwayFromZero final {
function roundAWAYFROMZERO (line 235) | inline constexpr roundAWAYFROMZERO{}
function final (line 237) | struct SRoundCeil final {
function roundCEIL (line 256) | inline constexpr roundCEIL{}
function final (line 258) | struct SRoundBanker final {
function roundBANKER (line 260) | inline constexpr roundBANKER{}
function final (line 262) | struct SNoRounding final {
function norounding (line 264) | inline constexpr norounding{}
function namespace (line 269) | namespace idiv_impl {
function Num (line 296) | [[nodiscard]] constexpr Num idiv(Num num, Denom denom, Round round) noex...
function Num (line 329) | constexpr Num scale_div( Num num, Denom denom, Round round ) noexcept {
function Num (line 334) | constexpr Num scale_div( Num num, Denom denom, SRoundNearest ) noexcept {
function Num (line 339) | [[nodiscard]] constexpr Num scale_div( Num num, Denom denom ) noexcept {
function T (line 344) | [[nodiscard]] constexpr T internal_lower_half(T t) noexcept {
function T (line 349) | [[nodiscard]] constexpr T internal_lower_half(T t) noexcept {
function T (line 373) | constexpr T scale_mul(T t, Factor factor, SRoundNearest ) noexcept {
function T (line 378) | constexpr T scale_mul(T t, Factor factor, TRound round) noexcept {
function T (line 383) | constexpr T scale_mul(T t, Factor factor, SRoundNearest ) noexcept {
function T (line 388) | [[nodiscard]] constexpr T scale_mul(T t, Factor factor) noexcept {
function namespace (line 395) | namespace no_adl {
function typename (line 416) | constexpr typename tc::is_actual_integer_like_or_constant<T>::int_t scal...
function typename (line 421) | constexpr typename tc::is_actual_integer_like_or_constant<T>::int_t scal...
function typename (line 426) | constexpr typename tc::is_actual_integer_like_or_constant<T>::int_t scal...
type fraction (line 440) | struct fraction {
function else (line 482) | struct fn_div {
function namespace (line 515) | namespace explicit_convert_adl {
FILE: tc/algorithm/round.t.cpp
function UNITTESTDEF (line 13) | UNITTESTDEF( rounding_cast ) {
function test_mul (line 51) | consteval auto test_mul(auto lhs, auto rhs) noexcept {
FILE: tc/algorithm/size.h
function namespace (line 23) | namespace tc {
function noexcept (line 168) | [[nodiscard]] constexpr auto make_size_proxy(T t) noexcept {
function noexcept (line 178) | [[nodiscard]] constexpr auto unmake_size_proxy(T t) noexcept {
function namespace (line 187) | namespace no_adl {
function namespace (line 207) | namespace no_adl {
function namespace (line 231) | namespace size_raw_internal {
FILE: tc/algorithm/size_bounded.h
function namespace (line 17) | namespace tc {
function T (line 44) | T const nBound) noexcept {
FILE: tc/algorithm/sort_streaming.h
function namespace (line 17) | namespace tc {
FILE: tc/algorithm/sort_streaming.t.cpp
function UNITTESTDEF (line 14) | UNITTESTDEF( sort_streaming ) {
FILE: tc/array.h
function namespace (line 28) | namespace tc {
function namespace (line 218) | namespace explicit_convert_adl {
function else (line 253) | else if constexpr( std::is_trivially_default_constructible<T>::value && ...
function namespace (line 275) | namespace no_adl {
function noexcept (line 308) | constexpr auto make_array(tc::aggregate_tag_t, Ts&&... ts) noexcept {
function noexcept (line 332) | [[nodiscard]] constexpr auto single(T&& t) noexcept {
FILE: tc/base/accessors.h
function namespace (line 17) | namespace tc {
function type (line 56) | [[nodiscard]] constexpr type&& funcname() && noexcept = delete; /* Visua...
FILE: tc/base/as_lvalue.h
function namespace (line 11) | namespace tc {
FILE: tc/base/assert_defs.h
function namespace (line 93) | namespace ErrorHandling {
function namespace (line 106) | namespace ErrorHandling {
function namespace (line 116) | namespace ErrorHandling {
FILE: tc/base/bit_cast.h
function namespace (line 18) | namespace tc {
function namespace (line 64) | namespace no_adl {
function namespace (line 162) | namespace no_adl {
function type (line 196) | static type construct(same_cvref_t<unsigned char,T>* pb) noexcept {
function type (line 206) | static type construct(same_cvref_t<unsigned char,T const>* pb) noexcept {
type type (line 217) | struct type {
function typename (line 232) | typename aliasing_ref<T>::type operator*() const& noexcept {
function typename (line 248) | typename aliasing_ref<T>::type operator[]( std::ptrdiff_t n ) const& noe...
function final (line 260) | struct aliasing_ptr<char> final {
function final (line 265) | struct aliasing_ptr<char const> final {
function final (line 270) | struct aliasing_ptr<unsigned char> final {
type aliasing_ptr (line 275) | struct aliasing_ptr
function Dst (line 280) | [[nodiscard]] Dst bit_cast_range(Src const& src) noexcept {
function Dst (line 292) | [[nodiscard]] constexpr Dst bit_cast(Src const& src) noexcept {
function typename (line 304) | [[nodiscard]] typename aliasing_ptr<std::remove_pointer_t<Dst>>::type al...
FILE: tc/base/bitfield.h
function namespace (line 20) | namespace tc {
FILE: tc/base/casts.h
function noexcept (line 114) | auto to_underlying_impl( T e ) noexcept {
function noexcept (line 120) | [[nodiscard]] constexpr auto to_underlying_impl(T b) noexcept {
function TTarget (line 267) | constexpr TTarget implicit_cast(TSource&& src) noexcept {
function TTarget (line 274) | [[nodiscard]] constexpr TTarget implicit_cast(TSource src) noexcept {
FILE: tc/base/casts.t.cpp
function static_tests_as_const (line 16) | [[maybe_unused]] void static_tests_as_const() {
type base (line 28) | struct base{}
type derived (line 29) | struct derived final : base{}
function UNITTESTDEF (line 32) | UNITTESTDEF(DerivedCastTests) {
FILE: tc/base/chained.h
function namespace (line 13) | namespace tc {
FILE: tc/base/change.h
function namespace (line 21) | namespace tc {
function noexcept (line 163) | bool const b) noexcept {
function assign_better (line 205) | constexpr bool assign_better( Better better, Var&& var, Val&&... val) no...
FILE: tc/base/conditional.t.cpp
type S (line 34) | struct S {}
function foo (line 47) | [[maybe_unused]] decltype(auto) foo(bool b, S&& s1, S&& s2) {
function foo (line 51) | [[maybe_unused]] decltype(auto) foo(bool b, int&& n1, int&& n2) {
function bar (line 55) | [[maybe_unused]] decltype(auto) bar(bool b, S&& s1, S&& s2) {
function bar (line 59) | [[maybe_unused]] decltype(auto) bar(bool b, int&& n1, int&& n2) {
FILE: tc/base/construction_restrictiveness.h
function namespace (line 15) | namespace tc {
FILE: tc/base/derivable.h
function namespace (line 20) | namespace no_adl {
FILE: tc/base/empty_chain.h
function namespace (line 13) | namespace tc {
FILE: tc/base/enum.h
function namespace (line 24) | namespace tc {
type CSaveHandler (line 143) | struct CSaveHandler
type CXmlReader (line 144) | struct CXmlReader
function namespace (line 147) | namespace tc {
function tc (line 187) | [[nodiscard]] constexpr tc::enumset<SFINAE_TYPE(Enum)> operator|(Enum lh...
function namespace (line 260) | namespace tc::enum_detail {
function namespace (line 296) | namespace tc {
FILE: tc/base/enum.t.cpp
function UNITTESTDEF (line 52) | UNITTESTDEF(enumset_index_inc_dec) {
FILE: tc/base/explicit_cast.h
function namespace (line 19) | namespace tc {
FILE: tc/base/explicit_cast_fwd.h
function DEFINE_TAG_TYPE (line 36) | DEFINE_TAG_TYPE(fill_tag)
function char_in_range (line 89) | [[nodiscard]] constexpr bool char_in_range(unsigned int const n) noexcept {
function namespace (line 104) | DEFINE_TMPL_FUNC_WITH_CUSTOMIZATIONS(explicit_convert)
FILE: tc/base/functors.h
function namespace (line 97) | namespace tc {
function namespace (line 144) | namespace tc {
function fn_subscript (line 185) | [[nodiscard]] fn_subscript final {
FILE: tc/base/fundamental.h
function namespace (line 63) | namespace tc {
FILE: tc/base/inplace.h
function namespace (line 26) | namespace tc {
FILE: tc/base/inside_unwinding.h
function namespace (line 6) | namespace tc {
FILE: tc/base/integer.h
function namespace (line 14) | namespace tc {
function Lhs (line 77) | [[nodiscard]] constexpr Lhs add( Lhs lhs, Rhs rhs ) noexcept {
function Lhs (line 88) | [[nodiscard]] constexpr Lhs sub( Lhs lhs, Rhs rhs ) noexcept {
FILE: tc/base/invoke.h
function namespace (line 19) | namespace tc {
FILE: tc/base/invoke.t.cpp
type test_arguments (line 16) | struct test_arguments {
function static_tests_invoke_arguments (line 26) | [[maybe_unused]] void static_tests_invoke_arguments() noexcept {
function static_tests_invoke (line 51) | [[maybe_unused]] void static_tests_invoke() noexcept {
function static_tests_apply (line 75) | [[maybe_unused]] void static_tests_apply() noexcept {
FILE: tc/base/invoke_with_constant.h
function namespace (line 16) | namespace tc {
FILE: tc/base/large_integer.h
function namespace (line 28) | namespace tc {
FILE: tc/base/modified.h
function namespace (line 13) | namespace tc {
FILE: tc/base/modified.t.cpp
function UNITTESTDEF (line 13) | UNITTESTDEF(tc_modified) {
FILE: tc/base/move.h
function namespace (line 16) | namespace tc {
function namespace (line 49) | namespace tc::move_detail {
function std (line 93) | [[nodiscard]] constexpr std::remove_reference_t<T>&& tc_move_always(T&& ...
function std (line 99) | [[nodiscard]] constexpr std::remove_reference_t<T>&& tc_move_always_even...
FILE: tc/base/noncopyable.h
function namespace (line 13) | namespace tc {
FILE: tc/base/ref.h
function namespace (line 15) | namespace tc {
function Ret (line 85) | Ret operator()(Args... args) const& noexcept(bNoExcept) {
function friend (line 129) | friend auto range_output_t_impl(any_range_ref const&) -> boost::mp11::mp...
FILE: tc/base/reference_or_value.h
function namespace (line 18) | namespace tc {
FILE: tc/base/renew.h
function namespace (line 17) | namespace tc {
FILE: tc/base/return_decltype.h
function namespace (line 13) | namespace tc {
FILE: tc/base/rvalue_property.t.cpp
type A (line 15) | struct A final {
method test_ (line 17) | static decltype(auto) test_(Self&& self) noexcept {
type B (line 33) | struct B final {
method test_ (line 35) | static decltype(auto) test_(Self&& self) noexcept {
type C (line 50) | struct C final {
method test_ (line 52) | static decltype(auto) test_(Self&& self) noexcept {
FILE: tc/base/safe_comparison.h
function namespace (line 15) | namespace tc {
FILE: tc/base/scope.h
function namespace (line 16) | namespace tc {
function operator (line 73) | constexpr operator tc::decay_t<T> const& () const& noexcept {
function namespace (line 111) | namespace no_adl {
FILE: tc/base/static_polymorphism.h
function namespace (line 15) | namespace tc {
FILE: tc/base/string_template_param.h
function namespace (line 13) | namespace tc {
FILE: tc/base/tag_type.h
function namespace (line 54) | namespace tc {
FILE: tc/base/temporary.h
function namespace (line 15) | namespace tc {
function namespace (line 65) | namespace no_adl {
function min_lifetime (line 146) | static constexpr unsigned min_lifetime() noexcept {
FILE: tc/base/track_instance.h
function namespace (line 15) | namespace tc {
FILE: tc/base/track_instance.t.cpp
function UNITTESTDEF (line 13) | UNITTESTDEF(track_instance) {
FILE: tc/base/trivial_functors.h
function namespace (line 14) | namespace tc {
type identity (line 33) | struct identity {
FILE: tc/base/trivial_functors.t.cpp
function static_test_make_constexpr_function (line 23) | [[maybe_unused]] void static_test_make_constexpr_function() noexcept {
FILE: tc/base/type_list.h
function namespace (line 17) | namespace tc {
function namespace (line 37) | namespace no_adl {
type mp_transform_impl (line 45) | struct mp_transform_impl
function namespace (line 55) | namespace no_adl {
function namespace (line 94) | namespace no_adl {
function namespace (line 120) | namespace no_adl {
FILE: tc/base/type_list.t.cpp
type my_tuple (line 29) | struct my_tuple {}
FILE: tc/base/type_traits.h
function namespace (line 22) | namespace tc::no_adl {
FILE: tc/base/type_traits.t.cpp
type TEnumClass (line 65) | enum class TEnumClass { a, b, c }
type TEnum (line 66) | enum TEnum { x, y, z }
type TPrimitiveEnum (line 72) | enum TPrimitiveEnum { a, b, c }
type TPrimitiveEnum2 (line 78) | enum TPrimitiveEnum2 { l, m }
type SBase (line 82) | struct SBase {}
type SDerived (line 83) | struct SDerived final : SBase {}
type SToInt (line 122) | struct SToInt final {
type A (line 182) | struct A {}
type B (line 183) | struct B : A {
type my_vector (line 624) | struct my_vector
method begin (line 628) | auto begin() & { return tc::begin(impl); }
method end (line 629) | auto end() & { return tc::begin(impl); }
type S (line 645) | struct S
method S (line 649) | S() {
method S (line 653) | S(S const& other) {
method S (line 657) | S(S&& other) {
method foo (line 665) | void foo() & {
method foo (line 669) | void foo() && {
method foo (line 673) | void foo() const& {
method foo (line 677) | void foo() const&& {
type S (line 648) | struct S{
method S (line 649) | S() {
method S (line 653) | S(S const& other) {
method S (line 657) | S(S&& other) {
method foo (line 665) | void foo() & {
method foo (line 669) | void foo() && {
method foo (line 673) | void foo() const& {
method foo (line 677) | void foo() const&& {
function S (line 688) | S createS(int) {
method S (line 649) | S() {
method S (line 653) | S(S const& other) {
method S (line 657) | S(S&& other) {
method foo (line 665) | void foo() & {
method foo (line 669) | void foo() && {
method foo (line 673) | void foo() const& {
method foo (line 677) | void foo() const&& {
function UNITTESTDEF (line 774) | UNITTESTDEF(minTest) {
type is_instance_test (line 894) | namespace is_instance_test {
type CTemplate1 (line 895) | struct CTemplate1 : tc::nonmovable {}
type CTemplate2 (line 896) | struct CTemplate2 : tc::nonmovable {}
type is_instance_ttn_test (line 912) | namespace is_instance_ttn_test {
type CTemplate1 (line 913) | struct CTemplate1 : tc::nonmovable {}
type CTemplate2 (line 914) | struct CTemplate2 : tc::nonmovable {}
type is_instance_or_derived_test (line 930) | namespace is_instance_or_derived_test {
type CTemplate1 (line 931) | struct CTemplate1 : tc::nonmovable {}
type CTemplate1Int (line 932) | struct CTemplate1Int : CTemplate1<int, T> {}
type CTemplate2 (line 933) | struct CTemplate2 : tc::nonmovable {
type CInstantiation1 (line 938) | struct CInstantiation1 : CTemplate1Int<bool> {
type CPrivateInstantiation1 (line 974) | struct CPrivateInstantiation1 : private CTemplate1<int, int> {
type is_instance_or_derived2_test (line 985) | namespace is_instance_or_derived2_test {
type CTemplate1 (line 988) | struct CTemplate1 : tc::nonmovable {}
type CTemplate2 (line 989) | struct CTemplate2 : tc::nonmovable {}
type CTemplate1Int (line 1008) | struct CTemplate1Int : CTemplate1<int, T, b> {}
type CInstantiation3 (line 1010) | struct CInstantiation3: CTemplate1Int<double, false> {
type noncopyable_test (line 1024) | namespace noncopyable_test {
type NonCopyable (line 1025) | struct NonCopyable final : tc::noncopyable {}
type NonMovable (line 1031) | struct NonMovable final : tc::nonmovable {}
FILE: tc/base/type_traits_fwd.h
function namespace (line 31) | namespace tc::static_assert_impl {
function final (line 72) | struct unused_arg final {}
function namespace (line 74) | namespace tc {
function namespace (line 274) | namespace tc {
function namespace (line 309) | namespace tc {
function namespace (line 661) | namespace no_adl {
function namespace (line 674) | namespace no_adl {
function namespace (line 694) | namespace no_adl {
function namespace (line 727) | namespace no_adl {
function namespace (line 768) | namespace no_adl {
function namespace (line 813) | namespace no_adl {
function namespace (line 831) | namespace no_adl {
function namespace (line 855) | namespace no_adl {
function namespace (line 874) | namespace no_adl {
FILE: tc/base/utility.h
function namespace (line 15) | namespace tc {
function namespace (line 79) | namespace is_contiguous_integer_sequence_impl {
function select_nth (line 100) | [[nodiscard]] constexpr decltype(auto) select_nth(auto&& a0, auto&&... a...
function select_nth (line 108) | [[nodiscard]] constexpr decltype(auto) select_nth(auto&& a0, auto&& a1, ...
function select_nth (line 118) | [[nodiscard]] constexpr decltype(auto) select_nth(auto&& a0, auto&& a1, ...
function select_nth (line 130) | [[nodiscard]] constexpr decltype(auto) select_nth(auto&& a0, auto&& a1, ...
function forward_like (line 148) | [[nodiscard]] constexpr decltype(auto) forward_like(T& t) noexcept {
function get_impl (line 169) | decltype(auto) get_impl(auto&& tpl) noexcept {
function get_impl (line 174) | decltype(auto) get_impl(auto&& tpl) noexcept {
function namespace (line 179) | namespace tc_get_impl {
function namespace (line 196) | namespace tc {
function namespace (line 221) | namespace tc {
function namespace (line 233) | namespace tc_swap_impl
function namespace (line 254) | namespace tc
function namespace (line 263) | namespace tc::as_constexpr_no_adl {
function namespace (line 295) | namespace tc::static_auto_constexpr_no_adl {
function namespace (line 332) | namespace tc {
function explicit (line 356) | constexpr explicit make_lazy(Func func) noexcept : Func(tc_move(func)) {}
function operator (line 358) | constexpr operator decltype(std::declval<Func const&>()())() const&& MAY...
function namespace (line 385) | namespace tc {
FILE: tc/base/utility.t.cpp
type make_integer_sequence_test (line 18) | namespace make_integer_sequence_test {
type is_contiguous_integer_sequence_test (line 36) | namespace is_contiguous_integer_sequence_test {
type constant_test (line 53) | namespace constant_test {
type decltype_return_test (line 73) | namespace decltype_return_test {
type A (line 74) | struct A {
method access_a (line 76) | void access_a() & noexcept {
method access_b (line 81) | void access_b() & noexcept {
method access_c (line 86) | void access_c() & noexcept {
FILE: tc/compat.t.cpp
function MODIFY_WARNINGS_END (line 21) | MODIFY_WARNINGS_END
type TransFilterTest (line 36) | struct TransFilterTest final {
type wrapped (line 38) | struct wrapped final {
method wrapped (line 39) | explicit wrapped(T const& t) noexcept : m_t(t) {}
method T (line 40) | T getT() const& noexcept { return m_t; }
method filter35 (line 46) | static bool filter35( wrapped_long const& wl ) noexcept { return wl.ge...
method transf_times_100 (line 47) | static std::size_t transf_times_100( wrapped_long const& wl ) noexcept...
method WlList (line 51) | WlList getWlList() const& noexcept { return m_list; }
method WlFilterdTransformedList (line 62) | WlFilterdTransformedList getWlFilterdTransformedList() const& noexcept {
method TransFilterTest (line 69) | TransFilterTest() noexcept {
function UNITTESTDEF (line 79) | UNITTESTDEF( TransFilterTest ) {
function UNITTESTDEF (line 88) | UNITTESTDEF( boost_iterator_range_compat ) {
type filter_stub (line 131) | struct filter_stub final { bool operator()(tc::unused) const& noexcept {...
type outer (line 133) | struct outer final {
method outer (line 136) | outer() noexcept {
method TRange (line 142) | TRange trans_range() & noexcept {
function UNITTESTDEF (line 147) | UNITTESTDEF( deduce_traits ) {
FILE: tc/const.t.cpp
function UNITTESTDEF (line 19) | UNITTESTDEF( const_range ) {
function UNITTESTDEF (line 46) | UNITTESTDEF( filter_const_filter_test ) {
FILE: tc/container/cont_assign.h
function namespace (line 19) | namespace tc {
function cont_change_with_or (line 75) | void cont_change_with_or(Cont& cont, Rng const& rng, bool& flag) noexcept {
function cont_change (line 115) | bool cont_change(T (&a)[N], Rng const& rng) noexcept {
FILE: tc/container/cont_assign.t.cpp
function UNITTESTDEF (line 16) | UNITTESTDEF(cont_assign_vec) {
function UNITTESTDEF (line 29) | UNITTESTDEF(cont_assign_slice) {
function UNITTESTDEF (line 36) | UNITTESTDEF(cont_assign_take_drop) {
FILE: tc/container/cont_reserve.h
function namespace (line 20) | namespace tc {
function namespace (line 74) | namespace cont_extend_detail {
function cont_extend (line 87) | void cont_extend(Cont& cont, typename boost::range_size< std::remove_ref...
function cont_extend (line 100) | void cont_extend(Cont& cont, typename boost::range_size< std::remove_ref...
function cont_extend_at (line 119) | [[nodiscard]] decltype(auto) cont_extend_at(Cont& cont, typename boost::...
FILE: tc/container/container.h
function namespace (line 29) | namespace tc {
FILE: tc/container/container_traits.h
function namespace (line 17) | namespace tc {
FILE: tc/container/insert.h
function namespace (line 22) | namespace tc {
function it (line 61) | auto it = tc::with_lazy_explicit_cast<tc::range_value_t<Cont&>>(
function namespace (line 70) | namespace cont_emplace_back_detail {
function else (line 77) | else if constexpr (0 == sizeof...(T) || tc::safely_constructible_from<tc...
function namespace (line 124) | namespace no_adl {
function pairitb (line 142) | auto const pairitb = tc::with_lazy_explicit_cast<tc::range_value_t<Cont&>>(
function namespace (line 150) | namespace no_adl {
function map_emplace_or_assign (line 196) | void map_emplace_or_assign(tc::unordered_map<Key, T, Hash, KeyEqual, All...
FILE: tc/container/string.h
function namespace (line 17) | namespace tc {
FILE: tc/create.t.cpp
function UNITTESTDEF (line 19) | UNITTESTDEF( create_range ) {
FILE: tc/dense_map.h
function namespace (line 26) | namespace tc {
function noexcept (line 82) | static constexpr auto end() noexcept {
function noexcept (line 86) | static constexpr auto size() noexcept {
function index_of (line 90) | static constexpr std::size_t index_of(std::partial_ordering order) noexc...
function index_of (line 97) | constexpr std::size_t index_of(tc::tuple<Ts...> const& tpl) const& noexc...
function tc (line 114) | static constexpr tc::all_values<Key> c_rngkey{}
type dense_map (line 117) | struct dense_map
function m_a (line 135) | constexpr dense_map() noexcept(std::is_nothrow_default_constructible<Val...
function explicit (line 138) | explicit dense_map(boost::container::default_init_t) noexcept(std::is_no...
function tc_member_init (line 141) | constexpr dense_map( tc::fill_tag_t, Args&&... val ) noexcept
function noexcept (line 155) | constexpr dense_map(First&& first, Second&& second, Args&& ...args) noex...
function explicit (line 162) | constexpr explicit dense_map(First&& first, Second&& second, Args&& ...a...
FILE: tc/dense_map.t.cpp
type NonCopyNonMoveable (line 23) | struct NonCopyNonMoveable {
method NonCopyNonMoveable (line 24) | NonCopyNonMoveable(NonCopyNonMoveable const&) = delete;
method NonCopyNonMoveable (line 25) | NonCopyNonMoveable(NonCopyNonMoveable&&) = delete;
method NonCopyNonMoveable (line 27) | NonCopyNonMoveable(int) {}
function UNITTESTDEF (line 30) | UNITTESTDEF(dense_map_with_non_moveable_type) {
function UNITTESTDEF (line 59) | UNITTESTDEF(test_dense_map_recursive_transform) {
function UNITTESTDEF (line 82) | UNITTESTDEF(test_dense_map_recursive_func_tag) {
function UNITTESTDEF (line 97) | UNITTESTDEF(test_dense_map_enumset_as_key) {
function UNITTESTDEF (line 106) | UNITTESTDEF(test_dense_map_transform_move) {
function UNITTESTDEF (line 113) | UNITTESTDEF(test_make_array_from_range) {
function UNITTESTDEF (line 127) | UNITTESTDEF(test_dense_map_with_ordering_key) {
function UNITTESTDEF (line 149) | UNITTESTDEF(dense_map_tuple) {
function UNITTESTDEF (line 171) | UNITTESTDEF(dense_map_dense_map) {
FILE: tc/enumset.h
function namespace (line 26) | namespace tc {
function size (line 171) | constexpr std::size_t size() const& noexcept {
function enumset (line 178) | static constexpr enumset none() noexcept {
function is_subset (line 205) | constexpr bool is_subset(NSub const nSub, NSuper const nSuper) noexcept {
function is_subset (line 210) | [[nodiscard]] constexpr bool is_subset(tc::enumset<Enum> const& seteSub,...
function is_subset (line 215) | [[nodiscard]] constexpr bool is_subset(Enum const eSub, tc::enumset<Enum...
function is_subset (line 220) | [[nodiscard]] constexpr bool is_subset(tc::enumset<Enum> const& seteSub,...
function namespace (line 224) | namespace no_adl {
function noexcept (line 243) | static constexpr auto end() noexcept {
function index_of (line 247) | static constexpr std::size_t index_of(tc::enumset<Enum> const& sete) noe...
function namespace (line 253) | namespace explicit_convert_adl {
FILE: tc/interval.h
function namespace (line 30) | namespace tc {
function namespace (line 122) | namespace interval_detail::no_adl {
function namespace (line 131) | namespace interval_adl {
function empty (line 269) | [[nodiscard]] constexpr bool empty() const& noexcept {
function difference_type (line 277) | [[nodiscard]] constexpr difference_type distance(T const& t) const& noex...
function difference_type (line 288) | [[nodiscard]] constexpr difference_type distance_inclusive(T const& t) c...
function difference_type (line 299) | [[nodiscard]] constexpr difference_type distance_inclusive(interval cons...
function newT (line 364) | [[nodiscard]] constexpr newT midpoint() const& noexcept {
function length (line 372) | [[nodiscard]] constexpr decltype(auto) length() const& noexcept {
function difference_type (line 387) | [[nodiscard]] constexpr difference_type OffsetToFit(interval<T> const& i...
function FitInsideOf (line 408) | constexpr void FitInsideOf(interval<T> const& intvl) & noexcept {
function newT (line 430) | [[nodiscard]] constexpr newT Val(EAlign const ealign) const& noexcept {
function contains (line 442) | [[nodiscard]] bool contains( interval_set<T, interval<T>, SetOrVectorImp...
function naive_contains (line 447) | [[nodiscard]] constexpr bool naive_contains( interval<U> const& intvl ) ...
function contains (line 453) | [[nodiscard]] constexpr bool contains( interval<U> const& intvl ) const&...
function contains (line 458) | [[nodiscard]] constexpr bool contains(S const& t) const& noexcept {
function contains_inclusive (line 463) | [[nodiscard]] constexpr bool contains_inclusive(S const& t) const& noexc...
function contains_exclusive (line 468) | [[nodiscard]] constexpr bool contains_exclusive(S const& t) const& noexc...
function intersects (line 473) | [[nodiscard]] bool intersects( interval_set<T, interval<T>, SetOrVectorI...
function intersects (line 480) | [[nodiscard]] constexpr bool intersects(interval<S> const& intvl) const&...
function naive_intersects (line 490) | [[nodiscard]] constexpr bool naive_intersects(interval<S> const& intvl) ...
function intersects_inclusive (line 496) | [[nodiscard]] constexpr bool intersects_inclusive(interval<S> const& int...
function CanonicalEmpty (line 514) | constexpr void CanonicalEmpty() & noexcept {
function negate (line 557) | constexpr void negate() & noexcept {
function THROW (line 575) | THROW(ExLoadFail) {
function noexcept (line 690) | constexpr auto make_singleton_interval(T&& value) noexcept {
function namespace (line 694) | namespace interval_adl {
function interval (line 731) | [[nodiscard]] constexpr interval<T> bound_interval( Rng const& rngintvl ...
function noexcept (line 736) | [[nodiscard]] constexpr auto minmax_interval(Rng&& rng, Pred const& pred...
function noexcept (line 749) | [[nodiscard]] constexpr auto minmax_interval(Rng&& rng) noexcept {
function noexcept (line 754) | [[nodiscard]] auto minmax_interval_elements(Rng&& rng) noexcept {
type linear_interval_transform (line 782) | struct linear_interval_transform
type flip_and_shift_transform (line 784) | struct flip_and_shift_transform
function Dst (line 821) | [[nodiscard]] Dst operator()(Src const& src) const& noexcept {
function noexcept (line 834) | auto length_transform() const& noexcept {
function Dst (line 870) | Dst operator()(Src const& src) const& noexcept {
function const (line 905) | bool operator()(TInterval const& intvlLeft, TInterval const& intvlRight)...
function const (line 910) | bool operator()(TInterval const& intvlLeft, T const& tRight) const& noex...
function const (line 913) | bool operator()(T const& tLeft, TInterval const& intvlRight) const& noex...
function iterator (line 925) | iterator lower_bound(T const& t) & noexcept {
function const_iterator (line 929) | const_iterator lower_bound(T const& t) const& noexcept {
function iterator (line 933) | iterator upper_bound(T const& t) & noexcept {
function const_iterator (line 937) | const_iterator upper_bound(T const& t) const& noexcept {
function namespace (line 959) | namespace interval_set_adl {
function erase (line 1076) | void erase(T const& t) & noexcept {
function intersects (line 1080) | bool intersects(TInterval const& intvl) const& noexcept {
function contains (line 1086) | bool contains(TInterval const& intvl) const& noexcept {
function contains (line 1095) | bool contains(T const& t) const& noexcept {
function erase_to (line 1104) | void erase_to(T const& t) & noexcept {
function erase_from (line 1116) | void erase_from(T const& t) & noexcept {
function const_iterator (line 1140) | const_iterator interval_below( T const& t ) const& noexcept {
function T (line 1145) | T const& closest_below( T const& t) const& noexcept {
function const_iterator (line 1149) | const_iterator interval_above( T const& t ) const& noexcept {
function T (line 1169) | T const& closest_above( T const& t) const& noexcept {
function T (line 1181) | T const& closest_missing_above( T const& t) const& noexcept {
function T (line 1185) | T const& closest_missing_below( T const& t) const& noexcept {
function T (line 1189) | T const& closest_missing(T const& t, tc::lohi const lohi) const& noexcept {
function T (line 1198) | T closest_missing_above(T t, T const& tLength) const& noexcept {
function const_iterator (line 1214) | const_iterator closest_interval( T const& t ) const& noexcept {
function T (line 1229) | T const& closest( T const& t) const& noexcept {
function T (line 1248) | T strict_closest(T const& t) const& noexcept {
function iterator (line 1455) | iterator begin() & noexcept {
function T (line 1467) | T accumulated_length() const& noexcept {
function noexcept (line 1499) | [[nodiscard]] auto ordered_overlapping_intervals(RngIntvl&& rngintvl, Le...
FILE: tc/interval.t.cpp
function UNITTESTDEF (line 20) | UNITTESTDEF(interval_center) {
function AssertNextAfter (line 133) | void AssertNextAfter() noexcept {
function UNITTESTDEF (line 146) | UNITTESTDEF(nextafter) {
function UNITTESTDEF (line 152) | UNITTESTDEF(linear_invert) {
function UNITTESTDEF (line 159) | UNITTESTDEF(minmax_interval) {
function UNITTESTDEF (line 163) | UNITTESTDEF(linear_interval_transform) {
FILE: tc/interval_types.h
function namespace (line 29) | namespace EAlign_adl {
function namespace (line 35) | namespace tc {
FILE: tc/optional.h
function namespace (line 21) | namespace tc {
function namespace (line 34) | namespace no_adl {
function TEmpty (line 241) | constexpr TEmpty operator*() const& noexcept {
function else (line 256) | else { // MSVC doesn't inline functions with try/catch
function noexcept (line 273) | constexpr optional(std::nullopt_t) noexcept {}
function TRef (line 315) | constexpr TRef operator*() const&& noexcept {
function operator (line 320) | constexpr auto operator->() const& noexcept {
function value_or (line 348) | constexpr decltype(auto) value_or( Optional&& optional, T&& t ) MAYTHROW {
function THROW (line 367) | THROW(Exception) {
function THROW (line 380) | THROW(Exception) {
function namespace (line 391) | namespace and_then_detail {
function namespace (line 425) | namespace and_then_adl {
function optional_emplace (line 471) | void optional_emplace(tc::optional<T>& o, Args&& ... args)
FILE: tc/optional.t.cpp
function test_optional_ctor (line 16) | void test_optional_ctor(T const& value) {
function test_optional_ops (line 47) | void test_optional_ops(T const& value1, U const& value2) {
function UNITTESTDEF (line 104) | UNITTESTDEF(optional) {
function UNITTESTDEF (line 122) | UNITTESTDEF(make_optional_reference_or_value) {
function UNITTESTDEF (line 149) | UNITTESTDEF(optional_as_range) {
FILE: tc/range/adjacent_adaptor.h
function namespace (line 19) | namespace adjacent_adaptor_detail {
function requires (line 189) | requires
function requires (line 221) | requires tc::has_decrement_index<std::remove_reference_t<Rng>> {
function requires (line 250) | requires tc::has_advance_index<std::remove_reference_t<Rng>> {
function requires (line 257) | requires tc::has_distance_to_index<std::remove_reference_t<Rng>> {
function requires (line 264) | requires tc::has_middle_point<std::remove_reference_t<Rng>> {
FILE: tc/range/cartesian_product_adaptor.h
function namespace (line 15) | namespace tc {
function namespace (line 215) | namespace no_adl {
type fn_middle_point (line 238) | struct fn_middle_point {
function internal_at_end_index (line 272) | constexpr bool internal_at_end_index(tc_index const& idx) const& MAYTHROW {
function requires (line 288) | requires c_bCommonRange {
FILE: tc/range/concat_adaptor.h
function namespace (line 30) | namespace tc {
function dToEnd (line 358) | auto const dToEnd = tc::distance_to_index(tc::get<nconstIndex()>(this->m...
function nconstIndex (line 417) | auto const nconstIndex) noexcept -> difference_type {
function namespace (line 444) | namespace no_adl {
function namespace (line 462) | namespace concat_detail {
function concat (line 476) | [[nodiscard]] constexpr decltype(auto) concat(Rng&&... rng) noexcept {
FILE: tc/range/concat_adaptor.t.cpp
type non_empty_generator (line 21) | struct non_empty_generator {
function UNITTESTDEF (line 25) | UNITTESTDEF(concat_void_generator_test) {
function UNITTESTDEF (line 41) | UNITTESTDEF(concat_break_or_continue_generator_test) {
function UNITTESTDEF (line 58) | UNITTESTDEF(concat_index_test) {
function UNITTESTDEF (line 96) | UNITTESTDEF(concat_with_empty_test) {
function UNITTESTDEF (line 113) | UNITTESTDEF(concat_different_value_types_test) {
function UNITTESTDEF (line 137) | UNITTESTDEF(concat_empty_test) {
function UNITTESTDEF (line 142) | UNITTESTDEF(concat_shallow_const_test) {
function UNITTESTDEF (line 151) | UNITTESTDEF(concat_deep_const_test) {
function UNITTESTDEF (line 159) | UNITTESTDEF(ConcatAdvanceToEndIterator) {
function UNITTESTDEF (line 185) | UNITTESTDEF(concat_flattening) {
type forward_range_base (line 204) | struct forward_range_base : tc::range_iterator_from_index<Derived, int> {
type forward_range (line 215) | struct forward_range : forward_range_base<forward_range> {}
type bidir_range (line 217) | struct bidir_range : forward_range_base<bidir_range> {
function concat_iterator_auto_traversal_static_tests (line 223) | [[maybe_unused]] void concat_iterator_auto_traversal_static_tests() {
FILE: tc/range/conditional_range.h
function namespace (line 26) | namespace tc {
function MAYTHROW (line 215) | auto begin() & MAYTHROW {
function MAYTHROW (line 218) | auto begin() const& MAYTHROW {
function transform_range_if (line 314) | decltype(auto) transform_range_if(Bool&& b, Rng&& rng, Fn fn) noexcept {
function namespace (line 322) | namespace switch_range_detail {
FILE: tc/range/conditional_range.t.cpp
function iterator_range_equal (line 30) | bool iterator_range_equal(Lhs const& lhs, Rhs const& rhs) {
function UNITTESTDEF (line 35) | UNITTESTDEF(conditional_range) {
FILE: tc/range/empty_range.h
function namespace (line 14) | namespace tc {
FILE: tc/range/filter_adaptor.h
function requires (line 125) | requires tc::has_decrement_index<Rng>
function requires (line 134) | requires tc::has_middle_point<Rng> && tc::has_decrement_index<Rng>
FILE: tc/range/index_iterator.h
function namespace (line 17) | namespace tc {
function IndexRange (line 164) | struct value_type_base<IndexRange> {
function element_type (line 216) | static constexpr element_type* to_address(pointer const& ptr) noexcept
function namespace (line 224) | namespace no_adl {
function namespace (line 229) | namespace index_iterator_impl {
FILE: tc/range/index_range.h
function namespace (line 32) | namespace tc {
function middle_point (line 263) | constexpr void middle_point(Rng const&, ItLhs& itLhs, ItRhs const& itRhs...
FILE: tc/range/intersection_adaptor.h
function namespace (line 16) | namespace tc {
FILE: tc/range/intersection_adaptor.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(intersection_difference) {
FILE: tc/range/iota_range.h
function namespace (line 18) | namespace tc {
function namespace (line 129) | namespace no_adl {
function namespace (line 146) | namespace no_adl {
function namespace (line 159) | namespace no_adl {
FILE: tc/range/iterator_cache.h
function namespace (line 15) | namespace tc {
FILE: tc/range/iterator_facade.h
function namespace (line 15) | namespace tc
FILE: tc/range/join_adaptor.h
function namespace (line 19) | namespace tc {
function namespace (line 213) | namespace join_default {
FILE: tc/range/join_framed_adaptor.h
function namespace (line 16) | namespace tc {
function namespace (line 50) | namespace no_adl {
FILE: tc/range/literal_range.h
function namespace (line 31) | namespace literal_range_adl {
function namespace (line 80) | namespace literal_range_detail {
FILE: tc/range/literal_range.t.cpp
function UNITTESTDEF (line 15) | UNITTESTDEF(literal_range) {
function UNITTESTDEF (line 21) | UNITTESTDEF(literal_range_string) {
FILE: tc/range/make_range.h
function namespace (line 13) | namespace tc {
FILE: tc/range/merge_range.h
function namespace (line 13) | namespace tc {
FILE: tc/range/merge_ranges.h
function namespace (line 14) | namespace tc {
FILE: tc/range/merge_ranges.t.cpp
function UNITTESTDEF (line 16) | UNITTESTDEF(merge_ranges_with_simple_usecase) {
function UNITTESTDEF (line 33) | UNITTESTDEF(zip_range_adaptor_test) {
function UNITTESTDEF (line 75) | UNITTESTDEF(merge_ranges_with_unique_range_2) {
FILE: tc/range/meta.h
function namespace (line 25) | namespace tc {
function CHAR_RANGE (line 352) | CHAR_RANGE(char)
function namespace (line 373) | namespace tc_begin_end_no_adl {
function namespace (line 387) | namespace tc {
function namespace (line 407) | namespace boost {
function namespace (line 439) | namespace no_adl {
function noexcept (line 446) | constexpr auto zip_get(Tuple&&... tuple) noexcept {
function noexcept (line 467) | constexpr auto zip(Tuple0&& tuple0, Tuple&&... tuple) noexcept {
function consteval (line 477) | [[nodiscard]] consteval tc::tuple<tc::constant<Is>...> index_sequence_as...
function namespace (line 493) | namespace no_adl {
FILE: tc/range/ordered_pairs.h
function namespace (line 13) | namespace tc {
FILE: tc/range/partial_sum.h
function namespace (line 15) | namespace tc {
FILE: tc/range/range.t.cpp
function UNITTESTDEF (line 28) | UNITTESTDEF( basic ) {
type generator_range (line 100) | struct generator_range {
function UNITTESTDEF (line 110) | UNITTESTDEF( generator_range ) {
function UNITTESTDEF (line 131) | UNITTESTDEF( N3752 ) {
type dummy_pred (line 310) | struct dummy_pred {
function UNITTESTDEF (line 410) | UNITTESTDEF(filter_with_generator_range) {
function UNITTESTDEF (line 518) | UNITTESTDEF(make_constexpr_array_test) {
function UNITTESTDEF (line 527) | UNITTESTDEF(join_repeat) {
function cartesian_product_test (line 539) | [[maybe_unused]] void cartesian_product_test(std::array<int, 2>& an) {
type adjacent_tuples_iterator_test (line 567) | namespace adjacent_tuples_iterator_test {
type non_empty (line 569) | namespace non_empty {
type empty (line 588) | namespace empty {
function UNITTESTDEF (line 611) | UNITTESTDEF(range_of_elements__dereference_index) {
FILE: tc/range/range_adaptor.h
function namespace (line 23) | namespace tc {
function namespace (line 217) | namespace generator_range_output_adaptor_adl {
function friend (line 226) | friend auto range_output_t_impl(generator_range_output_adaptor const&)
function noexcept (line 237) | constexpr auto generator_range_output(Rng&& rng) noexcept {
function namespace (line 241) | namespace range_output_from_base_range_adl {
function namespace (line 250) | namespace no_adl {
function namespace (line 283) | namespace index_range_adaptor_flags_adl {
function namespace (line 477) | namespace no_adl {
function namespace (line 525) | namespace tc::no_adl {
FILE: tc/range/range_return.h
function namespace (line 13) | namespace tc {
function return_border (line 255) | struct return_border_or_begin final : return_border {
function return_border (line 264) | struct return_border_or_end final : return_border {
function final (line 278) | struct return_border_or_null final {
function final (line 292) | struct return_border_index final {
function return_take_base (line 309) | struct return_take_or_empty : return_detail::no_adl::return_take_base {
function tc (line 410) | constexpr tc::range_value_t<Rng> pack_no_element(Rng&&) noexcept {
function tc (line 414) | constexpr tc::range_value_t<Rng> pack_no_element() noexcept {
function std (line 424) | constexpr std::optional<tc::range_value_t<Rng>> pack_element(tc::unused ...
function std (line 428) | constexpr std::optional<tc::range_value_t<Rng>> pack_element(It&& it, Rn...
function std (line 432) | constexpr std::optional<tc::range_value_t<Rng>> pack_element(Ref&& ref) ...
function std (line 436) | constexpr std::optional<tc::range_value_t<Rng>> pack_no_element(Rng&&) n...
function std (line 440) | constexpr std::optional<tc::range_value_t<Rng>> pack_no_element() noexce...
function noexcept (line 471) | constexpr auto pack_element(It&& it, Rng&& rng, tc::unused /*ref*/={}) n...
function noexcept (line 486) | constexpr auto pack_element(It&& it, Rng&& rng, tc::unused /*ref*/={}) n...
function pack_no_element (line 491) | constexpr decltype(std::optional(tc::make_size_proxy(tc::begin(std::decl...
function noexcept (line 503) | constexpr auto pack_no_element(Rng&&) noexcept {
function noexcept (line 510) | constexpr auto pack_no_element(Rng&& rng) noexcept {
function noexcept (line 519) | constexpr decltype(auto) pack_element(It&& it, Rng&& rng, tc::unused /*r...
function pack_no_element (line 523) | decltype(auto) pack_no_element(Rng&& rng) noexcept {
function return_decltype_noexcept (line 542) | constexpr auto pack_view(Rng&& rng, Begin&& begin, End&& end) return_dec...
function noexcept (line 555) | constexpr auto pack_view(Rng&& rng, Begin&& begin, End&& end) noexcept {
function return_view (line 565) | struct return_view_or_empty final : return_view {
function is_npos (line 635) | bool is_npos(T t) noexcept {
FILE: tc/range/repeat_n.h
function namespace (line 12) | namespace tc {
FILE: tc/range/reverse_adaptor.h
function namespace (line 18) | namespace tc {
FILE: tc/range/reverse_adaptor.t.cpp
function UNITTESTDEF (line 16) | UNITTESTDEF(tc_reverse_random_access) {
function UNITTESTDEF (line 41) | UNITTESTDEF(tc_reverse_binary_search) {
function UNITTESTDEF (line 60) | UNITTESTDEF(tc_reverse_bidirectional) {
function UNITTESTDEF (line 73) | UNITTESTDEF(tc_reverse_base_bound) {
function UNITTESTDEF (line 85) | UNITTESTDEF(tc_reverse_drop_first_last_inplace) {
FILE: tc/range/sparse_adaptor.h
function namespace (line 18) | namespace tc {
FILE: tc/range/sparse_adaptor.t.cpp
function UNITTESTDEF (line 14) | UNITTESTDEF(sparse_range) {
FILE: tc/range/subrange.h
function namespace (line 35) | namespace tc {
function noexcept (line 384) | [[nodiscard]] constexpr auto make_empty_range() noexcept {
function return_decltype_noexcept (line 397) | auto as_array(T (&at)[N] ) return_decltype_noexcept(
function else (line 418) | else if constexpr( (tc::instance<Cont, std::vector> || tc::instance<Cont...
function no_adl (line 444) | [[nodiscard]] constexpr no_adl::subrange<Rng>&& take( no_adl::subrange<R...
function namespace (line 490) | namespace begin_next_detail {
function noexcept (line 514) | constexpr auto begin_next(
function noexcept (line 539) | [[nodiscard]] constexpr auto begin_next(
function noexcept (line 547) | [[nodiscard]] auto linear_begin_next(
function namespace (line 554) | namespace end_prev_detail {
function noexcept (line 591) | [[nodiscard]] constexpr auto end_prev(
function namespace (line 606) | namespace take_first_detail {
function namespace (line 693) | namespace take_first_adaptor_adl {
function namespace (line 742) | namespace no_adl {
function namespace (line 787) | namespace drop_first_adaptor_adl {
FILE: tc/range/subrange.t.cpp
function UNITTESTDEF (line 36) | UNITTESTDEF( subrange_array ) {
function UNITTESTDEF (line 46) | UNITTESTDEF( const_subrange_char_ptr ) {
function ref_test (line 58) | [[maybe_unused]] void ref_test(SRVI & rng) noexcept {
function UNITTESTDEF (line 65) | UNITTESTDEF( const_subrange ) {
function UNITTESTDEF (line 79) | UNITTESTDEF( sub_subrange_rvalue ) {
function UNITTESTDEF (line 93) | UNITTESTDEF( sub_subrange_lvalue ) {
function UNITTESTDEF (line 114) | UNITTESTDEF( sub_subrange_index ) {
function UNITTESTDEF (line 131) | UNITTESTDEF(union_range_tests) {
function UNITTESTDEF (line 195) | UNITTESTDEF(union_range_generator) {
function UNITTESTDEF (line 224) | UNITTESTDEF(subrange_with_tranform) {
function UNITTESTDEF (line 366) | UNITTESTDEF(Unique_Ranges) {
function UNITTESTDEF (line 456) | UNITTESTDEF(difference_range) {
function UNITTESTDEF (line 466) | UNITTESTDEF(difference_unordered_set) {
function UNITTESTDEF (line 489) | UNITTESTDEF(tc_unique) {
type MovingInt (line 538) | struct MovingInt final {
method MovingInt (line 541) | MovingInt(int n) noexcept : m_n(n)
method MovingInt (line 544) | MovingInt(MovingInt&& other) noexcept : m_n(other.m_n)
method MovingInt (line 549) | MovingInt(MovingInt const&) = delete;
method MovingInt (line 550) | MovingInt& operator=(MovingInt& other) = delete;
method MovingInt (line 552) | MovingInt& operator=(MovingInt&& other) & noexcept {
function UNITTESTDEF (line 564) | UNITTESTDEF(tc_unique_inplace) {
function UNITTESTDEF (line 583) | UNITTESTDEF( take_first_sink ) {
function UNITTESTDEF (line 602) | UNITTESTDEF( drop_first_sink ) {
function UNITTESTDEF (line 622) | UNITTESTDEF( span_from_subrange ) {
type STestPtrs (line 629) | struct STestPtrs {
method STestPtrs (line 630) | constexpr STestPtrs(char const* itBegin,char const* itEnd): m_itBegin(...
function UNITTESTDEF (line 637) | UNITTESTDEF( constexpr_ptr_to_string_literal_runtime_bug ) {
function UNITTESTDEF (line 649) | UNITTESTDEF(and_then) {
function UNITTESTDEF (line 700) | UNITTESTDEF( subrange_index_translation ) {
FILE: tc/range/take_while.h
type take_while_adaptor (line 23) | struct take_while_adaptor
function MAYTHROW (line 40) | auto for_each_impl(Self&& self, Sink&& sink) MAYTHROW {
FILE: tc/range/take_while.t.cpp
function UNITTESTDEF (line 16) | UNITTESTDEF(GeneratorRangeTakeWhile) {
FILE: tc/range/transform.h
function namespace (line 16) | namespace tc {
FILE: tc/range/transform.t.cpp
function static_tests (line 18) | [[maybe_unused]] void static_tests() noexcept {
function UNITTESTDEF (line 53) | UNITTESTDEF(vector_int_ref_need_sfinae_transform) {
FILE: tc/range/transform_adaptor.h
function namespace (line 20) | namespace tc {
function untransform (line 126) | decltype(auto) untransform(Rng&& rng) noexcept {
function noexcept (line 132) | [[nodiscard]] auto untransform(Rng&& rng) noexcept {
FILE: tc/range/union_adaptor.h
function namespace (line 18) | namespace tc {
FILE: tc/range/unique_range_adaptor.h
function namespace (line 19) | namespace tc {
function namespace (line 99) | namespace unique_adaptor_adl {
function requires (line 195) | requires tc::has_decrement_index<std::remove_reference_t<Rng>>
function namespace (line 206) | namespace subrange_range_adaptor_detail::no_adl {
function namespace (line 218) | namespace subrange_range_adaptor_adl {
function tc_index (line 265) | tc_index idx{idxBegin, idxBegin};
function namespace (line 303) | namespace no_adl {
FILE: tc/range/zip_range.h
function namespace (line 22) | namespace tc {
function MAYTHROW (line 63) | constexpr auto operator()(auto&& u) & MAYTHROW {
function namespace (line 156) | namespace trait_from_concept_workaround { // workaround Xcode14.1 segmen...
type zip_detail (line 170) | struct zip_detail
function generator_index (line 175) | static constexpr std::size_t generator_index() noexcept {
function MAYTHROW (line 208) | auto for_each_impl(Self&& self, Sink&& sink) MAYTHROW {
function MemberRangeAtEnd (line 290) | auto MemberRangeAtEnd =
function n (line 437) | auto const n = tc::empty(rngrng) ? 0 : tc::size(tc::front(rngrng)); // D...
function noexcept (line 472) | [[nodiscard]] constexpr auto enumerate(Rng&& rng) noexcept {
FILE: tc/range/zip_range.t.cpp
type traversal_override_adaptor (line 17) | struct traversal_override_adaptor
method traversal_override_adaptor (line 24) | traversal_override_adaptor(Rng& rng) : base_(tc::aggregate_tag, rng) {}
method STATIC_FINAL (line 26) | STATIC_FINAL(decrement_index)(tc_index& idx) const& MAYTHROW
method STATIC_FINAL_MOD (line 33) | STATIC_FINAL_MOD(constexpr, advance_index)(tc_index& idx, typename boo...
method STATIC_FINAL_MOD (line 40) | STATIC_FINAL_MOD(constexpr, distance_to_index)(tc_index const& idxLhs,...
function UNITTESTDEF (line 49) | UNITTESTDEF(zip_range_supported_ops) {
function UNITTESTDEF (line 101) | UNITTESTDEF(zip_range_difference_type) {
function UNITTESTDEF (line 120) | UNITTESTDEF(zip_range_sort_inplace) {
function UNITTESTDEF (line 132) | UNITTESTDEF(zip_range_range_output_t) {
FILE: tc/restricted_enum.h
function namespace (line 27) | namespace tc {
function actual_integer (line 102) | actual_integer Integral>
function namespace (line 111) | namespace detail
FILE: tc/restricted_enum.t.cpp
function implicit_cast (line 39) | void implicit_cast() noexcept {
function test (line 52) | void test() {
function restricted_enums (line 64) | void restricted_enums() noexcept {
function UNITTESTDEF (line 94) | UNITTESTDEF(restricted_enum_arithmetic) {
FILE: tc/static_vector.h
function namespace (line 24) | namespace tc {
function T (line 133) | [[nodiscard]] constexpr T const* data() const& noexcept {
function namespace (line 188) | namespace static_vector_adl {
function resize (line 271) | constexpr void resize(tc::static_vector_size_t const n, boost::container...
function MAYTHROW (line 312) | constexpr auto make_static_vector(Rng&& rng) MAYTHROW {
function MAYTHROW (line 317) | constexpr auto make_static_vector(Rng&&... rng) MAYTHROW {
FILE: tc/storage_for.h
function namespace (line 22) | namespace tc {
function ctor (line 194) | void ctor() & noexcept(noexcept(Base::ctor())) {
FILE: tc/string/ascii.h
function namespace (line 19) | namespace tc {
FILE: tc/string/char.h
function namespace (line 16) | namespace tc {
type std (line 43) | struct std
function assign (line 50) | static constexpr void assign(char_type& r, const char_type& a) noexcept {
function char_type (line 54) | static char_type* assign(char_type* p, std::size_t count, char_type a) {
function eq (line 59) | static constexpr bool eq(char_type a, char_type b) noexcept {
function lt (line 63) | static constexpr bool lt(char_type a, char_type b) noexcept {
function length (line 67) | static constexpr std::size_t length(const char_type* s) noexcept {
function char_type (line 76) | static constexpr const char_type* find(const char_type* p, std::size_t c...
function compare (line 88) | static constexpr int compare(const char_type* s1, const char_type* s2, s...
function char_type (line 96) | static char_type* move(char_type* dest, const char_type* src, std::size_...
function char_type (line 105) | static char_type* copy(char_type* dest, const char_type* src, std::size_...
function namespace (line 110) | namespace tc {
function namespace (line 125) | namespace tc {
FILE: tc/string/char.t.cpp
type is_convertible_to_ascii_supporting_types (line 21) | struct is_convertible_to_ascii_supporting_types final {
function UNITTESTDEF (line 49) | UNITTESTDEF(append_char_ascii) {
function UNITTESTDEF (line 98) | UNITTESTDEF(string_literal) {
function UNITTESTDEF (line 115) | UNITTESTDEF(char_literal) {
FILE: tc/string/convert_enc.h
function namespace (line 20) | namespace tc {
function surrogate_pair_value (line 150) | constexpr char32_t surrogate_pair_value(tc::char16 const chLeading, tc::...
function onSequenceSize (line 170) | auto const onSequenceSize=tc::codeunit_sequence_size_raw(ch)
function else (line 225) | else if constexpr( std::same_as<tc::char16, Char> ) {
function switch_no_default (line 238) | switch_no_default(nCodeUnitIndex) {
function else (line 250) | else if constexpr( std::same_as<tc::char16, Char> ) {
function namespace (line 268) | namespace convert_enc_impl {
function MAYTHROW (line 349) | auto codepoint_at(decltype(tc_index::m_idx) const& idxBaseRng) const& MA...
function base_range_ (line 441) | constexpr decltype(auto) base_range_(Self&& self) noexcept {
function base_range_ (line 466) | constexpr decltype(auto) base_range_(Self&& self) noexcept {
function return_decltype_noexcept (line 476) | constexpr auto border_base_index(tc_index const& idx) const& return_decl...
function namespace (line 493) | namespace convert_enc_detail {
function convert_enc (line 509) | decltype(auto) convert_enc(Src&& src) noexcept {
function namespace (line 536) | namespace no_adl {
FILE: tc/string/convert_enc.t.cpp
function IsSingle (line 15) | [[nodiscard]] bool constexpr IsSingle(Char const ch) noexcept {
function IsLeading (line 20) | [[nodiscard]] bool constexpr IsLeading(Char const ch) noexcept {
function IsTrailing (line 25) | [[nodiscard]] bool constexpr IsTrailing(Char const ch) noexcept {
FILE: tc/string/format.h
function namespace (line 30) | namespace tc {
FILE: tc/string/jsonparser.h
function namespace (line 32) | namespace tc::json {
function namespace (line 304) | namespace tc {
function namespace (line 309) | namespace tc::json {
function namespace (line 396) | namespace no_adl {
function skip_one_or_more_digits (line 500) | auto const skip_one_or_more_digits = [&]() MAYTHROW {
function invoke_sink (line 671) | auto const invoke_sink = [&](std::size_t const idx) MAYTHROW {
function OptT (line 749) | OptT ot{}
function MAYTHROW (line 864) | [[nodiscard]] auto expect_single_member_object(Group&& group) & MAYTHROW {
FILE: tc/string/jsonparser.t.cpp
function Accepts (line 19) | bool Accepts(auto const& str) noexcept {
function UNITTESTDEF (line 38) | UNITTESTDEF(JSONTestSuite) {
function UNITTESTDEF (line 397) | UNITTESTDEF(JSONTestSuiteStress) {
function UNITTESTDEF (line 403) | UNITTESTDEF(JSONDecode) {
function UNITTESTDEF (line 423) | UNITTESTDEF(JSONArray_Manual) {
function UNITTESTDEF (line 439) | UNITTESTDEF(JSONArray_ManualLoop) {
function UNITTESTDEF (line 447) | UNITTESTDEF(JSONArray_FuncIdx) {
function UNITTESTDEF (line 455) | UNITTESTDEF(JSONArray_Func) {
function UNITTESTDEF (line 464) | UNITTESTDEF(JSONObject_ManualLoop) {
function UNITTESTDEF (line 479) | UNITTESTDEF(JSONObject_Members) {
FILE: tc/string/make_c_str.h
function namespace (line 17) | namespace tc {
FILE: tc/string/make_c_str.t.cpp
function check_make_c_str_fwd (line 31) | bool check_make_c_str_fwd(Char1 const* str1, Char2 const* str2) noexcept {
function check_make_c_str_fwd (line 36) | bool check_make_c_str_fwd(Char1 const*, Char2 const*) noexcept {
function UNITTESTDEF (line 41) | UNITTESTDEF(make_c_str_fwd_test) {
function check_make_c_str (line 63) | bool check_make_c_str(Char const* str1, Str const& str2) noexcept {
function UNITTESTDEF (line 68) | UNITTESTDEF(make_c_str_test) {
FILE: tc/string/named.h
function namespace (line 14) | namespace tc {
FILE: tc/string/parserbase.h
function namespace (line 16) | namespace tc {
FILE: tc/string/spirit.h
function namespace (line 52) | namespace boost::fusion {
function namespace (line 164) | namespace tc {
function namespace (line 203) | namespace no_adl {
function any_one_impl (line 222) | struct any_one_impl final : x3::char_parser<any_one_impl> {
function namespace (line 235) | namespace no_adl {
function namespace (line 262) | namespace no_adl {
function namespace (line 286) | namespace no_adl {
function namespace (line 312) | namespace no_adl {
function namespace (line 335) | namespace no_adl {
function asciiblank (line 356) | inline constexpr auto asciiblank = no_adl::asciiblank{}
function asciispace (line 357) | inline constexpr auto asciispace = no_adl::asciispace{}
function namespace (line 373) | namespace no_adl {
function namespace (line 405) | namespace no_adl {
function noexcept (line 429) | constexpr auto move_attr_to_val() noexcept {
function namespace (line 437) | namespace boost::spirit::x3 {
function namespace (line 519) | namespace boost::spirit::x3::traits
function call (line 544) | static bool call(tc::static_vector<T, N> const& c) noexcept
FILE: tc/string/spirit/support/char_encoding/ascii.hpp
type boost (line 31) | namespace boost { namespace spirit { namespace char_encoding
type spirit (line 31) | namespace spirit { namespace char_encoding
type char_encoding (line 31) | namespace char_encoding
type ascii (line 183) | struct ascii
method isascii_ (line 188) | static bool
method ischar (line 194) | static bool
method strict_ischar (line 206) | static bool
method isalnum (line 212) | static bool
method isalpha (line 220) | static bool
method isdigit (line 227) | static bool
method isxdigit (line 234) | static bool
method iscntrl (line 241) | static bool
method isgraph (line 248) | static bool
method islower (line 255) | static bool
method isprint (line 262) | static bool
method ispunct (line 269) | static bool
method isspace (line 276) | static bool
method BOOST_PREVENT_MACRO_SUBSTITUTION (line 283) | static bool
method isupper (line 290) | static bool
method tolower (line 301) | static int
method toupper (line 308) | static int
method toucs4 (line 315) | static ::boost::uint32_t
FILE: tc/string/spirit/support/char_encoding/iso8859_1.hpp
type boost (line 31) | namespace boost { namespace spirit { namespace char_encoding
type spirit (line 31) | namespace spirit { namespace char_encoding
type char_encoding (line 31) | namespace char_encoding
type iso8859_1 (line 569) | struct iso8859_1
method isascii_ (line 574) | static bool
method ischar (line 580) | static bool
method strict_ischar (line 594) | static bool
method isalnum (line 600) | static bool
method isalpha (line 608) | static bool
method isdigit (line 615) | static bool
method isxdigit (line 622) | static bool
method iscntrl (line 629) | static bool
method isgraph (line 636) | static bool
method islower (line 642) | static bool
method isprint (line 649) | static bool
method ispunct (line 655) | static bool
method isspace (line 662) | static bool
method BOOST_PREVENT_MACRO_SUBSTITUTION (line 669) | static bool
method isupper (line 676) | static bool
method tolower (line 687) | static int
method toupper (line 695) | static int
method toucs4 (line 703) | static ::boost::uint32_t
FILE: tc/string/spirit/support/char_encoding/standard.hpp
type boost (line 20) | namespace boost { namespace spirit { namespace char_encoding
type spirit (line 20) | namespace spirit { namespace char_encoding
type char_encoding (line 20) | namespace char_encoding
type standard (line 25) | struct standard
method isascii_ (line 30) | static bool
method ischar (line 36) | static bool
method strict_ischar (line 50) | static bool
method isalnum (line 57) | static bool
method isalpha (line 64) | static bool
method isdigit (line 71) | static bool
method isxdigit (line 78) | static bool
method iscntrl (line 85) | static bool
method isgraph (line 92) | static bool
method islower (line 99) | static bool
method isprint (line 106) | static bool
method ispunct (line 113) | static bool
method isspace (line 120) | static bool
method BOOST_PREVENT_MACRO_SUBSTITUTION (line 127) | static bool
method isupper (line 134) | static bool
method tolower (line 145) | static int
method toupper (line 152) | static int
method toucs4 (line 159) | static ::boost::uint32_t
FILE: tc/string/spirit/support/char_encoding/standard_wide.hpp
type boost (line 24) | namespace boost { namespace spirit { namespace traits
type spirit (line 24) | namespace spirit { namespace traits
type traits (line 24) | namespace traits
type wchar_t_size (line 27) | struct wchar_t_size
type wchar_t_size<1> (line 33) | struct wchar_t_size<1> { enum { mask = 0xff }; }
type wchar_t_size<2> (line 34) | struct wchar_t_size<2> { enum { mask = 0xffff }; }
type wchar_t_size<4> (line 35) | struct wchar_t_size<4> { enum { mask = 0xffffffff }; }
type char_encoding (line 39) | namespace char_encoding
type standard_wide (line 45) | struct standard_wide
method to_int_type (line 51) | static typename std::char_traits<Char>::int_type
method Char (line 58) | static Char
method ischar (line 64) | static bool
method isalnum (line 78) | static bool
method isalpha (line 85) | static bool
method iscntrl (line 92) | static bool
method isdigit (line 99) | static bool
method isgraph (line 106) | static bool
method islower (line 113) | static bool
method isprint (line 120) | static bool
method ispunct (line 127) | static bool
method isspace (line 134) | static bool
method isupper (line 141) | static bool
method isxdigit (line 148) | static bool
method BOOST_PREVENT_MACRO_SUBSTITUTION (line 155) | static bool
method wchar_t (line 165) | static wchar_t
method wchar_t (line 173) | static wchar_t
method toucs4 (line 181) | static ::boost::uint32_t
type spirit (line 39) | namespace spirit { namespace char_encoding
type traits (line 24) | namespace traits
type wchar_t_size (line 27) | struct wchar_t_size
type wchar_t_size<1> (line 33) | struct wchar_t_size<1> { enum { mask = 0xff }; }
type wchar_t_size<2> (line 34) | struct wchar_t_size<2> { enum { mask = 0xffff }; }
type wchar_t_size<4> (line 35) | struct wchar_t_size<4> { enum { mask = 0xffffffff }; }
type char_encoding (line 39) | namespace char_encoding
type standard_wide (line 45) | struct standard_wide
method to_int_type (line 51) | static typename std::char_traits<Char>::int_type
method Char (line 58) | static Char
method ischar (line 64) | static bool
method isalnum (line 78) | static bool
method isalpha (line 85) | static bool
method iscntrl (line 92) | static bool
method isdigit (line 99) | static bool
method isgraph (line 106) | static bool
method islower (line 113) | static bool
method isprint (line 120) | static bool
method ispunct (line 127) | static bool
method isspace (line 134) | static bool
method isupper (line 141) | static bool
method isxdigit (line 148) | static bool
method BOOST_PREVENT_MACRO_SUBSTITUTION (line 155) | static bool
method wchar_t (line 165) | static wchar_t
method wchar_t (line 173) | static wchar_t
method toucs4 (line 181) | static ::boost::uint32_t
type boost (line 39) | namespace boost { namespace spirit { namespace char_encoding
type spirit (line 24) | namespace spirit { namespace traits
type traits (line 24) | namespace traits
type wchar_t_size (line 27) | struct wchar_t_size
type wchar_t_size<1> (line 33) | struct wchar_t_size<1> { enum { mask = 0xff }; }
type wchar_t_size<2> (line 34) | struct wchar_t_size<2> { enum { mask = 0xffff }; }
type wchar_t_size<4> (line 35) | struct wchar_t_size<4> { enum { mask = 0xffffffff }; }
type char_encoding (line 39) | namespace char_encoding
type standard_wide (line 45) | struct standard_wide
method to_int_type (line 51) | static typename std::char_traits<Char>::int_type
method Char (line 58) | static Char
method ischar (line 64) | static bool
method isalnum (line 78) | static bool
method isalpha (line 85) | static bool
method iscntrl (line 92) | static bool
method isdigit (line 99) | static bool
method isgraph (line 106) | static bool
method islower (line 113) | static bool
method isprint (line 120) | static bool
method ispunct (line 127) | static bool
method isspace (line 134) | static bool
method isupper (line 141) | static bool
method isxdigit (line 148) | static bool
method BOOST_PREVENT_MACRO_SUBSTITUTION (line 155) | static bool
method wchar_t (line 165) | static wchar_t
method wchar_t (line 173) | static wchar_t
method toucs4 (line 181) | static ::boost::uint32_t
type spirit (line 39) | namespace spirit { namespace char_encoding
type traits (line 24) | namespace traits
type wchar_t_size (line 27) | struct wchar_t_size
type wchar_t_size<1> (line 33) | struct wchar_t_size<1> { enum { mask = 0xff }; }
type wchar_t_size<2> (line 34) | struct wchar_t_size<2> { enum { mask = 0xffff }; }
type wchar_t_size<4> (line 35) | struct wchar_t_size<4> { enum { mask = 0xffffffff }; }
type char_encoding (line 39) | namespace char_encoding
type standard_wide (line 45) | struct standard_wide
method to_int_type (line 51) | static typename std::char_traits<Char>::int_type
method Char (line 58) | static Char
method ischar (line 64) | static bool
method isalnum (line 78) | static bool
method isalpha (line 85) | static bool
method iscntrl (line 92) | static bool
method isdigit (line 99) | static bool
method isgraph (line 106) | static bool
method islower (line 113) | static bool
method isprint (line 120) | static bool
method ispunct (line 127) | static bool
method isspace (line 134) | static bool
method isupper (line 141) | static bool
method isxdigit (line 148) | static bool
method BOOST_PREVENT_MACRO_SUBSTITUTION (line 155) | static bool
method wchar_t (line 165) | static wchar_t
method wchar_t (line 173) | static wchar_t
method toucs4 (line 181) | static ::boost::uint32_t
FILE: tc/string/spirit/support/char_encoding/unicode.hpp
type boost (line 18) | namespace boost { namespace spirit { namespace char_encoding
type spirit (line 18) | namespace spirit { namespace char_encoding
type char_encoding (line 18) | namespace char_encoding
type unicode (line 23) | struct unicode
method isascii_ (line 35) | static bool
method ischar (line 41) | static bool
method isalnum (line 48) | static bool
method isalpha (line 54) | static bool
method isdigit (line 60) | static bool
method isxdigit (line 66) | static bool
method iscntrl (line 72) | static bool
method isgraph (line 78) | static bool
method islower (line 84) | static bool
method isprint (line 90) | static bool
method ispunct (line 96) | static bool
method isspace (line 102) | static bool
method BOOST_PREVENT_MACRO_SUBSTITUTION (line 108) | static bool
method isupper (line 114) | static bool
method char_type (line 124) | static char_type
method char_type (line 130) | static char_type
method toucs4 (line 136) | static ::boost::uint32_t
FILE: tc/string/spirit/support/char_encoding/unicode/category_table.hpp
type boost (line 11) | namespace boost { namespace spirit { namespace ucd { namespace detail
type spirit (line 11) | namespace spirit { namespace ucd { namespace detail
type ucd (line 11) | namespace ucd { namespace detail
type detail (line 11) | namespace detail
function category_lookup (line 3312) | inline ::boost::uint16_t category_lookup(::boost::uint32_t ch)
FILE: tc/string/spirit/support/char_encoding/unicode/lowercase_table.hpp
type boost (line 11) | namespace boost { namespace spirit { namespace ucd { namespace detail
type spirit (line 11) | namespace spirit { namespace ucd { namespace detail
type ucd (line 11) | namespace ucd { namespace detail
type detail (line 11) | namespace detail
function lowercase_lookup (line 747) | inline ::boost::uint32_t lowercase_lookup(::boost::uint32_t ch)
FILE: tc/string/spirit/support/char_encoding/unicode/query.hpp
type boost (line 20) | namespace boost { namespace spirit { namespace ucd
type spirit (line 20) | namespace spirit { namespace ucd
type ucd (line 20) | namespace ucd
type properties (line 25) | struct properties
type major_category (line 31) | enum major_category
type category (line 42) | enum category
type derived_properties (line 82) | enum derived_properties
type script (line 93) | enum script
function get_category (line 263) | inline properties::category get_category(::boost::uint32_t ch)
function get_major_category (line 268) | inline properties::major_category get_major_category(::boost::uint...
function is_punctuation (line 273) | inline bool is_punctuation(::boost::uint32_t ch)
function is_decimal_number (line 278) | inline bool is_decimal_number(::boost::uint32_t ch)
function is_hex_digit (line 283) | inline bool is_hex_digit(::boost::uint32_t ch)
function is_control (line 288) | inline bool is_control(::boost::uint32_t ch)
function is_alphabetic (line 293) | inline bool is_alphabetic(::boost::uint32_t ch)
function is_alphanumeric (line 298) | inline bool is_alphanumeric(::boost::uint32_t ch)
function is_uppercase (line 303) | inline bool is_uppercase(::boost::uint32_t ch)
function is_lowercase (line 308) | inline bool is_lowercase(::boost::uint32_t ch)
function is_white_space (line 313) | inline bool is_white_space(::boost::uint32_t ch)
function is_blank (line 318) | inline bool is_blank(::boost::uint32_t ch)
function is_graph (line 332) | inline bool is_graph(::boost::uint32_t ch)
function is_print (line 341) | inline bool is_print(::boost::uint32_t ch)
function is_noncharacter_code_point (line 346) | inline bool is_noncharacter_code_point(::boost::uint32_t ch)
function is_default_ignorable_code_point (line 351) | inline bool is_default_ignorable_code_point(::boost::uint32_t ch)
function get_script (line 356) | inline properties::script get_script(::boost::uint32_t ch)
function to_lowercase (line 361) | inline ::boost::uint32_t to_lowercase(::boost::uint32_t ch)
function to_uppercase (line 368) | inline ::boost::uint32_t to_uppercase(::boost::uint32_t ch)
FILE: tc/string/spirit/support/char_encoding/unicode/script_table.hpp
type boost (line 11) | namespace boost { namespace spirit { namespace ucd { namespace detail
type spirit (line 11) | namespace spirit { namespace ucd { namespace detail
type ucd (line 11) | namespace ucd { namespace detail
type detail (line 11) | namespace detail
function script_lookup (line 3312) | inline ::boost::uint8_t script_lookup(::boost::uint32_t ch)
FILE: tc/string/spirit/support/char_encoding/unicode/uppercase_table.hpp
type boost (line 11) | namespace boost { namespace spirit { namespace ucd { namespace detail
type spirit (line 11) | namespace spirit { namespace ucd { namespace detail
type ucd (line 11) | namespace ucd { namespace detail
type detail (line 11) | namespace detail
function uppercase_lookup (line 804) | inline ::boost::uint32_t uppercase_lookup(::boost::uint32_t ch)
FILE: tc/string/spirit/support/char_set/basic_chset.hpp
type boost (line 21) | namespace boost { namespace spirit { namespace support { namespace detail
type spirit (line 21) | namespace spirit { namespace support { namespace detail
type support (line 21) | namespace support { namespace detail
type detail (line 21) | namespace detail
type basic_chset (line 29) | struct basic_chset
method basic_chset (line 31) | basic_chset() {}
method basic_chset (line 32) | basic_chset(basic_chset const& arg_)
method test (line 35) | bool
method set (line 41) | void
method set (line 47) | void
method clear (line 53) | void
method clear (line 59) | void
method clear (line 65) | void
method inverse (line 71) | void
method swap (line 83) | void
method basic_chset (line 90) | basic_chset&
method basic_chset (line 99) | basic_chset&
method basic_chset (line 112) | basic_chset&
method basic_chset (line 121) | basic_chset&
type basic_chset_8bit (line 142) | struct basic_chset_8bit
method basic_chset_8bit (line 144) | basic_chset_8bit() {}
method basic_chset_8bit (line 145) | basic_chset_8bit(basic_chset_8bit const& arg_)
method test (line 148) | bool
method set (line 154) | void
method set (line 161) | void
method clear (line 167) | void
method clear (line 174) | void
method clear (line 180) | void
method inverse (line 186) | void
method swap (line 192) | void
method basic_chset_8bit (line 198) | basic_chset_8bit&
method basic_chset_8bit (line 205) | basic_chset_8bit&
method basic_chset_8bit (line 212) | basic_chset_8bit&
method basic_chset_8bit (line 219) | basic_chset_8bit&
type basic_chset<char> (line 231) | struct basic_chset<char>
type basic_chset<signed char> (line 236) | struct basic_chset<signed char>
type basic_chset<unsigned char> (line 241) | struct basic_chset<unsigned char>
FILE: tc/string/spirit/support/char_set/range.hpp
type boost (line 14) | namespace boost { namespace spirit { namespace support { namespace detail
type spirit (line 14) | namespace spirit { namespace support { namespace detail
type support (line 14) | namespace support { namespace detail
type detail (line 14) | namespace detail
type range (line 20) | struct range
method range (line 24) | range() : first(), last() {}
method range (line 25) | range(T first_, T last_) : first(first_), last(last_) {}
FILE: tc/string/spirit/support/char_set/range_functions.hpp
type boost (line 16) | namespace boost { namespace spirit { namespace support { namespace detail
type spirit (line 16) | namespace spirit { namespace support { namespace detail
type support (line 16) | namespace support { namespace detail
type detail (line 16) | namespace detail
function is_valid (line 19) | inline bool
function includes (line 27) | inline bool
function includes (line 35) | inline bool
function can_merge (line 43) | inline bool
function merge (line 64) | inline void
type range_compare (line 75) | struct range_compare
FILE: tc/string/spirit/support/char_set/range_run.hpp
type boost (line 17) | namespace boost { namespace spirit { namespace support { namespace detail
type spirit (line 17) | namespace spirit { namespace support { namespace detail
type support (line 17) | namespace support { namespace detail
type detail (line 17) | namespace detail
class range_run (line 36) | class range_run
FILE: tc/string/spirit/support/char_set/range_run_impl.hpp
type boost (line 18) | namespace boost { namespace spirit { namespace support { namespace detail
type spirit (line 18) | namespace spirit { namespace support { namespace detail
type support (line 18) | namespace support { namespace detail
type detail (line 18) | namespace detail
function try_merge (line 21) | inline bool
FILE: tc/string/spirit/unittest/actions.t.cpp
type fun_action (line 28) | struct fun_action
type setnext (line 44) | struct setnext
method setnext (line 46) | setnext(char& next) : next(next) {}
type stationary (line 58) | struct stationary : boost::noncopyable
method stationary (line 60) | explicit stationary(int i) : val{i} {}
method stationary (line 61) | stationary& operator=(int i) { val = i; return *this; }
function UNITTESTDEF (line 67) | UNITTESTDEF(x3_test_actions)
FILE: tc/string/spirit/unittest/alternative.t.cpp
type di_ignore (line 19) | struct di_ignore
type di_include (line 24) | struct di_include
type undefined (line 37) | struct undefined {}
type stationary (line 40) | struct stationary : boost::noncopyable
method stationary (line 42) | explicit stationary(int i) : val{i} {}
method stationary (line 43) | stationary& operator=(int i) { val = i; return *this; }
function UNITTESTDEF (line 49) | UNITTESTDEF(x3_test_alternative)
FILE: tc/string/spirit/unittest/and_predicate.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_and_predicate)
FILE: tc/string/spirit/unittest/attr.t.cpp
function UNITTESTDEF (line 13) | UNITTESTDEF(x3_test_attr)
FILE: tc/string/spirit/unittest/attribute_type_check.t.cpp
type checked_attr_parser (line 16) | struct checked_attr_parser : x3::attr_parser<Value>
method checked_attr_parser (line 20) | checked_attr_parser(Value const& value) : base_t(value) {}
method checked_attr_parser (line 21) | checked_attr_parser(Value&& value) : base_t(std::move(value)) {}
method parse (line 25) | bool parse(Iterator& first, Iterator const& last
function checked_attr (line 35) | static inline checked_attr_parser<boost::decay_t<Value>, Expected>
function test_expr (line 41) | static void test_expr(Value const& v, Expr&& expr)
function gen_sequence (line 50) | static void gen_sequence(Attribute const& attribute, Expr&& expr)
function gen_sequence (line 57) | static void gen_sequence(Attribute const& attribute, Expr&& expr, Value ...
function gen_sequence_tests (line 65) | static void gen_sequence_tests(Attribute const& attribute, Value const& ...
function gen_single_item_tests (line 72) | static void gen_single_item_tests(Value const& v)
function gen_single_item_tests (line 80) | static void gen_single_item_tests(Value const& v, Tail const&... tail)
function gen_tests (line 87) | static void gen_tests(Values const&... values)
function make_test (line 96) | void make_test(Attributes const&... attrs)
function UNITTESTDEF (line 111) | UNITTESTDEF(x3_test_attribute_type_check)
FILE: tc/string/spirit/unittest/binary.t.cpp
function UNITTESTDEF (line 13) | UNITTESTDEF(x3_test_binary)
FILE: tc/string/spirit/unittest/bool.hpp
type backwards_bool_policies (line 15) | struct backwards_bool_policies : boost::spirit::x3::bool_policies<>
method parse_false (line 19) | static bool
type test_bool_type (line 34) | struct test_bool_type
method test_bool_type (line 36) | test_bool_type(bool b = false) : b(b) {}
FILE: tc/string/spirit/unittest/bool.t.cpp
function UNITTESTDEF (line 10) | UNITTESTDEF(x3_test_bool)
FILE: tc/string/spirit/unittest/char1.t.cpp
function UNITTESTDEF (line 20) | UNITTESTDEF(x3_test_char1)
FILE: tc/string/spirit/unittest/char_class.t.cpp
function UNITTESTDEF (line 17) | UNITTESTDEF(x3_test_char_class)
FILE: tc/string/spirit/unittest/confix.t.cpp
function UNITTESTDEF (line 16) | UNITTESTDEF(x3_test_confix)
FILE: tc/string/spirit/unittest/container_support.t.cpp
type check_substitute (line 28) | namespace check_substitute {
type foo (line 29) | struct foo {}
type bar (line 30) | struct bar { using type = T; }
type is_bar (line 31) | struct is_bar : std::false_type {}
type is_bar<bar<T>> (line 32) | struct is_bar<bar<T>> : std::true_type {}
type boost (line 35) | namespace boost { namespace spirit { namespace x3 { namespace traits {
type spirit (line 35) | namespace spirit { namespace x3 { namespace traits {
type x3 (line 35) | namespace x3 { namespace traits {
type traits (line 35) | namespace traits {
type is_substitute<foo<T>, foo<U>> (line 39) | struct is_substitute<foo<T>, foo<U>> : is_substitute<T, U> {}
type is_substitute<T, U, std::enable_if_t<is_bar<T>::value && is_bar<U>::value>> (line 42) | struct is_substitute<T, U, std::enable_if_t<is_bar<T>::value && ...
type check_substitute (line 46) | namespace check_substitute {
type foo (line 29) | struct foo {}
type bar (line 30) | struct bar { using type = T; }
type is_bar (line 31) | struct is_bar : std::false_type {}
type is_bar<bar<T>> (line 32) | struct is_bar<bar<T>> : std::true_type {}
class pair_rule (line 55) | class pair_rule
class string_rule (line 56) | class string_rule
function test_map_support (line 64) | void test_map_support()
function test_multimap_support (line 88) | void test_multimap_support()
function test_sequence_support (line 112) | void test_sequence_support()
function test_set_support (line 136) | void test_set_support()
function test_multiset_support (line 160) | void test_multiset_support()
function test_string_support (line 184) | void test_string_support()
function UNITTESTDEF (line 207) | UNITTESTDEF(x3_test_container_support)
FILE: tc/string/spirit/unittest/difference.t.cpp
function UNITTESTDEF (line 13) | UNITTESTDEF(x3_test_difference)
FILE: tc/string/spirit/unittest/eoi.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_eoi)
FILE: tc/string/spirit/unittest/eol.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_eol)
FILE: tc/string/spirit/unittest/eps.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_eps)
FILE: tc/string/spirit/unittest/error_handler.t.cpp
type error_handler_base (line 16) | struct error_handler_base
method on_error (line 19) | x3::error_handler_result on_error(
type test_inner_rule_class (line 30) | struct test_inner_rule_class
type test_rule_class (line 31) | struct test_rule_class : x3::annotate_on_success, error_handler_base {}
function test (line 40) | void test(std::string const& line_break) {
function test_line_break_first (line 66) | void test_line_break_first(std::string const& line_break) {
function UNITTESTDEF (line 80) | UNITTESTDEF(x3_test_error_handler) {
FILE: tc/string/spirit/unittest/expect.t.cpp
function UNITTESTDEF (line 17) | UNITTESTDEF(x3_test_expect)
FILE: tc/string/spirit/unittest/extract_int.t.cpp
type custom_int (line 21) | struct custom_int
method custom_int (line 23) | custom_int() = default;
method custom_int (line 24) | constexpr custom_int(int value) : value_{value} {}
method custom_int (line 26) | custom_int operator+(custom_int x) const { return value_ + x.value_; }
method custom_int (line 27) | custom_int operator-(custom_int x) const { return value_ - x.value_; }
method custom_int (line 28) | custom_int operator*(custom_int x) const { return value_ * x.value_; }
method custom_int (line 29) | custom_int operator/(custom_int x) const { return value_ / x.value_; }
method custom_int (line 31) | custom_int& operator+=(custom_int x) { value_ += x.value_; return *thi...
method custom_int (line 32) | custom_int& operator-=(custom_int x) { value_ -= x.value_; return *thi...
method custom_int (line 33) | custom_int& operator*=(custom_int x) { value_ *= x.value_; return *thi...
method custom_int (line 34) | custom_int& operator/=(custom_int x) { value_ /= x.value_; return *thi...
method custom_int (line 35) | custom_int& operator++() { ++value_; return *this; }
method custom_int (line 36) | custom_int& operator--() { --value_; return *this; }
method custom_int (line 37) | custom_int operator++(int) { return value_++; }
method custom_int (line 38) | custom_int operator--(int) { return value_--; }
method custom_int (line 40) | custom_int operator+() { return +value_; }
method custom_int (line 41) | custom_int operator-() { return -value_; }
type utils (line 63) | namespace utils {
type digits (line 65) | struct digits
type digits<-9, 9> (line 66) | struct digits<-9, 9> { static constexpr int r2 = 3, r10 = 1; }
type digits<-10, 10> (line 67) | struct digits<-10, 10> { static constexpr int r2 = 3, r10 = 1; }
type digits<-15, 15> (line 68) | struct digits<-15, 15> { static constexpr int r2 = 3, r10 = 1; }
type std (line 72) | namespace std {
class numeric_limits<custom_int<Min, Max>> (line 75) | class numeric_limits<custom_int<Min, Max>> : public numeric_limits<int>
method max (line 78) | static constexpr custom_int<Min, Max> max() noexcept { return Max; }
method min (line 79) | static constexpr custom_int<Min, Max> min() noexcept { return Min; }
method lowest (line 80) | static constexpr custom_int<Min, Max> lowest() noexcept { return min...
function test_overflow_handling (line 91) | void test_overflow_handling(char const* begin, char const* end, int i)
function test_unparsed_digits_are_not_consumed (line 115) | void test_unparsed_digits_are_not_consumed(char const* it, char const* e...
function run_tests (line 137) | void run_tests(char const* begin, char const* end, int i)
function UNITTESTDEF (line 147) | UNITTESTDEF(x3_test_extract_int)
FILE: tc/string/spirit/unittest/fusion_map.t.cpp
type AdaptedStruct (line 16) | struct AdaptedStruct {
class key1_attr (line 21) | class key1_attr {}
class key2_attr (line 22) | class key2_attr {}
function test_attr (line 31) | bool test_attr(const std::string in,Parser const& p, Attribute& attr) {
function UNITTESTDEF (line 36) | UNITTESTDEF(x3_test_fusion_map)
FILE: tc/string/spirit/unittest/grammar.hpp
type grammar_r (line 5) | struct grammar_r
FILE: tc/string/spirit/unittest/grammar_linker.t.cpp
function UNITTESTDEF (line 11) | UNITTESTDEF(x3_test_grammar_linker)
FILE: tc/string/spirit/unittest/int.hpp
type custom_int (line 47) | struct custom_int
method custom_int (line 50) | custom_int() : n(0) {}
method custom_int (line 51) | explicit custom_int(int n_) : n(n_) {}
method custom_int (line 52) | custom_int& operator=(int n_) { n = n_; return *this; }
method custom_int (line 55) | custom_int operator*(custom_int a, custom_int b) { return custom_int(a...
method custom_int (line 56) | custom_int operator+(custom_int a, custom_int b) { return custom_int(a...
method custom_int (line 57) | custom_int operator-(custom_int a, custom_int b) { return custom_int(a...
FILE: tc/string/spirit/unittest/int1.t.cpp
function UNITTESTDEF (line 14) | UNITTESTDEF(x3_test_int1)
FILE: tc/string/spirit/unittest/iterator_check.t.cpp
function UNITTESTDEF (line 17) | UNITTESTDEF(x3_test_iterator_check)
FILE: tc/string/spirit/unittest/kleene.t.cpp
type x_attr (line 16) | struct x_attr
type boost (line 20) | namespace boost { namespace spirit { namespace x3 { namespace traits
type spirit (line 20) | namespace spirit { namespace x3 { namespace traits
type x3 (line 20) | namespace x3 { namespace traits
type traits (line 20) | namespace traits
type container_value<x_attr> (line 23) | struct container_value<x_attr>
type push_back_container<x_attr> (line 29) | struct push_back_container<x_attr>
method call (line 31) | static bool call(x_attr& /*c*/, char /*val*/)
function UNITTESTDEF (line 39) | UNITTESTDEF(x3_test_kleene)
FILE: tc/string/spirit/unittest/lexeme.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_lexeme)
FILE: tc/string/spirit/unittest/list.t.cpp
function UNITTESTDEF (line 19) | UNITTESTDEF(x3_test_list)
FILE: tc/string/spirit/unittest/lit.t.cpp
function UNITTESTDEF (line 11) | UNITTESTDEF(x3_test_lit)
FILE: tc/string/spirit/unittest/lit1.t.cpp
function UNITTESTDEF (line 14) | UNITTESTDEF(x3_test_lit1)
FILE: tc/string/spirit/unittest/lit2.t.cpp
function UNITTESTDEF (line 14) | UNITTESTDEF(x3_test_lit2)
FILE: tc/string/spirit/unittest/matches.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_matches)
FILE: tc/string/spirit/unittest/no_case.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_no_case)
FILE: tc/string/spirit/unittest/no_skip.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_no_skip)
FILE: tc/string/spirit/unittest/not_predicate.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_not_predicate)
FILE: tc/string/spirit/unittest/omit.t.cpp
class direct_rule (line 18) | class direct_rule
class indirect_rule (line 19) | class indirect_rule
function UNITTESTDEF (line 27) | UNITTESTDEF(x3_test_omit)
FILE: tc/string/spirit/unittest/optional_x3.t.cpp
type adata (line 19) | struct adata
type test_attribute_type (line 29) | struct test_attribute_type
function UNITTESTDEF (line 38) | UNITTESTDEF(x3_test_optional)
FILE: tc/string/spirit/unittest/plus.t.cpp
type x_attr (line 17) | struct x_attr
type boost (line 21) | namespace boost { namespace spirit { namespace x3 { namespace traits
type spirit (line 21) | namespace spirit { namespace x3 { namespace traits
type x3 (line 21) | namespace x3 { namespace traits
type traits (line 21) | namespace traits
type container_value<x_attr> (line 24) | struct container_value<x_attr>
type push_back_container<x_attr> (line 30) | struct push_back_container<x_attr>
method call (line 32) | static bool call(x_attr& /*c*/, char /*val*/)
function UNITTESTDEF (line 40) | UNITTESTDEF(x3_test_plus)
FILE: tc/string/spirit/unittest/raw.t.cpp
class direct_rule (line 16) | class direct_rule
class indirect_rule (line 17) | class indirect_rule
function UNITTESTDEF (line 25) | UNITTESTDEF(x3_test_raw)
FILE: tc/string/spirit/unittest/real.hpp
type ts_real_policies (line 25) | struct ts_real_policies : boost::spirit::x3::ureal_policies<T>
method parse_frac_n (line 29) | static bool
method parse_exp (line 38) | static bool
method parse_exp_n (line 46) | static bool
method parse_n (line 54) | static bool
type no_trailing_dot_policy (line 82) | struct no_trailing_dot_policy : boost::spirit::x3::real_policies<T>
type no_leading_dot_policy (line 88) | struct no_leading_dot_policy : boost::spirit::x3::real_policies<T>
function compare (line 94) | bool compare(T n, boost::type_identity_t<T> expected)
type custom_real (line 106) | struct custom_real
method custom_real (line 109) | custom_real() : n(0) {}
method custom_real (line 110) | custom_real(double n_) : n(n_) {}
method custom_real (line 113) | custom_real operator*(custom_real a, custom_real b)
method custom_real (line 115) | custom_real operator+(custom_real a, custom_real b)
method custom_real (line 117) | custom_real operator-(custom_real a, custom_real b)
FILE: tc/string/spirit/unittest/real1.t.cpp
function UNITTESTDEF (line 13) | UNITTESTDEF(x3_test_real1)
FILE: tc/string/spirit/unittest/real2.t.cpp
function basic_real_parser_test (line 14) | void basic_real_parser_test(P parser)
function UNITTESTDEF (line 52) | UNITTESTDEF(x3_test_real2)
FILE: tc/string/spirit/unittest/real3.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_real3)
FILE: tc/string/spirit/unittest/real4.t.cpp
function UNITTESTDEF (line 15) | UNITTESTDEF(x3_test_real4)
FILE: tc/string/spirit/unittest/repeat.t.cpp
function UNITTESTDEF (line 22) | UNITTESTDEF(x3_test_repeat)
FILE: tc/string/spirit/unittest/rule1.t.cpp
function UNITTESTDEF (line 13) | UNITTESTDEF(x3_test_rule1)
FILE: tc/string/spirit/unittest/rule2.t.cpp
type check_no_rule_injection_parser (line 17) | struct check_no_rule_injection_parser
method parse (line 25) | bool parse(Iterator&, Iterator const&, Context const&,
function UNITTESTDEF (line 38) | UNITTESTDEF(x3_test_rule2)
FILE: tc/string/spirit/unittest/rule3.t.cpp
type f (line 26) | struct f
type stationary (line 36) | struct stationary : boost::noncopyable
method stationary (line 38) | explicit stationary(int i) : val{i} {}
method stationary (line 39) | stationary& operator=(int i) { val = i; return *this; }
type check_stationary (line 45) | namespace check_stationary {
class a_r (line 47) | class a_r
class b_r (line 48) | class b_r
type check_recursive (line 57) | namespace check_recursive {
class grammar_r (line 64) | class grammar_r
type check_recursive_scoped (line 72) | namespace check_recursive_scoped {
class intvec_r (line 76) | class intvec_r
type recursive_tuple (line 81) | struct recursive_tuple
type check_recursive_tuple (line 90) | namespace check_recursive_tuple {
class grammar_r (line 92) | class grammar_r
function UNITTESTDEF (line 107) | UNITTESTDEF(x3_test_rule3)
FILE: tc/string/spirit/unittest/rule4.t.cpp
type my_rule_class (line 19) | struct my_rule_class
method on_error (line 22) | x3::error_handler_result
method on_success (line 29) | inline void
type on_success_gets_preskipped_iterator (line 36) | struct on_success_gets_preskipped_iterator
method on_success (line 41) | void on_success(Iterator before, Iterator& after, Attribute&, Context ...
type on_success_advance_iterator (line 48) | struct on_success_advance_iterator
method on_success (line 51) | void on_success(Iterator const&, Iterator& after, Attribute&, Context ...
type on_success_advance_iterator_mutref (line 56) | struct on_success_advance_iterator_mutref
method on_success (line 59) | void on_success(Iterator&, Iterator& after, Attribute&, Context const&)
type on_success_advance_iterator_byval (line 64) | struct on_success_advance_iterator_byval
method on_success (line 67) | void on_success(Iterator, Iterator& after, Attribute&, Context const&)
function UNITTESTDEF (line 73) | UNITTESTDEF(x3_test_rule4)
FILE: tc/string/spirit/unittest/rule_separate_tu.t.cpp
type sem_act (line 12) | namespace sem_act {
class used_attr1_r (line 18) | class used_attr1_r
class used_attr2_r (line 22) | class used_attr2_r
class unused_attr1_r (line 26) | class unused_attr1_r
class unused_attr2_r (line 30) | class unused_attr2_r
function UNITTESTDEF (line 36) | UNITTESTDEF(x3_test_rule_separate_tu)
FILE: tc/string/spirit/unittest/rule_separate_tu_grammar.hpp
type unused_attr (line 14) | namespace unused_attr {
class skipper_r (line 19) | class skipper_r
class skipper2_r (line 24) | class skipper2_r
class grammar_r (line 29) | class grammar_r
type used_attr (line 37) | namespace used_attr {
class skipper_r (line 41) | class skipper_r
class grammar_r (line 45) | class grammar_r
FILE: tc/string/spirit/unittest/rule_separate_tu_grammar.t.cpp
type unused_attr (line 14) | namespace unused_attr {
type used_attr (line 50) | namespace used_attr {
FILE: tc/string/spirit/unittest/seek.t.cpp
function UNITTESTDEF (line 21) | UNITTESTDEF(x3_test_seek)
FILE: tc/string/spirit/unittest/sequence.t.cpp
function UNITTESTDEF (line 17) | UNITTESTDEF(x3_test_sequence)
FILE: tc/string/spirit/unittest/skip.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_skip)
FILE: tc/string/spirit/unittest/symbols1.t.cpp
type custom_string_c (line 12) | struct custom_string_c
method custom_string_c (line 14) | custom_string_c(char c) { str[0] = c; str[1] = '\0'; }
function UNITTESTDEF (line 23) | UNITTESTDEF(x3_test_symbols1)
FILE: tc/string/spirit/unittest/symbols2.t.cpp
type custom_string_c (line 12) | struct custom_string_c
method custom_string_c (line 14) | custom_string_c(char c) { str[0] = c; str[1] = '\0'; }
function get_str (line 23) | std::string get_str(char const* str)
function UNITTESTDEF (line 28) | UNITTESTDEF(x3_test_symbols2)
FILE: tc/string/spirit/unittest/symbols3.t.cpp
type roman (line 22) | struct roman
function eval (line 33) | int eval(roman const & c)
function UNITTESTDEF (line 38) | UNITTESTDEF(x3_test_symbols3)
FILE: tc/string/spirit/unittest/test.hpp
type spirit_test (line 16) | namespace spirit_test
function test (line 19) | bool test(Char const* in, Parser const& p, bool full_match = true)
function test (line 29) | bool test(boost::basic_string_view<Char, std::char_traits<Char>> in,
function test (line 39) | bool test(Char const* in, Parser const& p
function test_failure (line 50) | bool test_failure(Char const* in, Parser const& p)
function test_failure (line 61) | bool test_failure(boost::basic_string_view<Char, std::char_traits<Char...
function test_attr (line 69) | bool test_attr(Char const* in, Parser const& p
function test_attr (line 80) | bool test_attr(Char const* in, Parser const& p
function binary_test (line 91) | bool binary_test(Char const* in, std::size_t size, Parser const& p,
function binary_test (line 100) | bool binary_test(Char const* in, std::size_t size, Parser const& p,
function binary_test_attr (line 109) | bool binary_test_attr(Char const* in, std::size_t size, Parser const& p,
function binary_test_attr (line 118) | bool binary_test_attr(Char const* in, std::size_t size, Parser const& p,
function always_true (line 128) | constexpr bool always_true(T&&...) { return true; }
function test_ctors (line 131) | constexpr bool test_ctors(Parser const& p)
FILE: tc/string/spirit/unittest/to_utf8.t.cpp
function nowarn_constexpr (line 11) | static bool nowarn_constexpr(bool x) { return x; }
function UNITTESTDEF (line 13) | UNITTESTDEF(x3_test_to_utf8)
FILE: tc/string/spirit/unittest/tst.t.cpp
function add (line 21) | void add(TST& tst, Char const* s, int data)
function remove (line 30) | void remove(TST& tst, Char const* s)
function docheck (line 39) | void docheck(TST const& tst, CaseCompare const& comp, Char const* s, boo...
type printer (line 53) | struct printer
function print (line 63) | void print(TST const& tst)
function tests (line 78) | void tests()
function UNITTESTDEF (line 329) | UNITTESTDEF(x3_test_tst)
FILE: tc/string/spirit/unittest/uint.hpp
type custom_uint (line 36) | struct custom_uint
method custom_uint (line 39) | custom_uint() : n(0) {}
method custom_uint (line 40) | explicit custom_uint(unsigned n_) : n(n_) {}
method custom_uint (line 41) | custom_uint& operator=(unsigned n_) { n = n_; return *this; }
method custom_uint (line 46) | custom_uint operator*(custom_uint a, custom_uint b)
method custom_uint (line 48) | custom_uint operator+(custom_uint a, custom_uint b)
FILE: tc/string/spirit/unittest/uint1.t.cpp
function UNITTESTDEF (line 12) | UNITTESTDEF(x3_test_uint1)
FILE: tc/string/spirit/unittest/uint_radix.t.cpp
function UNITTESTDEF (line 14) | UNITTESTDEF(x3_test_uint_radix)
FILE: tc/string/spirit/unittest/unused_type.t.cpp
function test_use (line 13) | void test_use(boost::spirit::x3::unused_type) {}
function UNITTESTDEF (line 15) | UNITTESTDEF(x3_test_unused_type)
FILE: tc/string/spirit/unittest/utils.hpp
type move_only (line 13) | struct move_only
method move_only (line 15) | move_only() = default;
method move_only (line 16) | move_only(move_only&&) = default;
method move_only (line 17) | move_only& operator=(move_only&&) = default;
type synth_parser (line 22) | struct synth_parser : boost::spirit::x3::parser<synth_parser<T>>
method parse (line 31) | bool parse(Iterator& iter, Iterator const& last, Context const&,
FILE: tc/string/spirit/unittest/with.t.cpp
type my_tag (line 12) | struct my_tag
type my_rule_class (line 14) | struct my_rule_class
method on_error (line 17) | x3::error_handler_result
method on_success (line 25) | inline void
function UNITTESTDEF (line 32) | UNITTESTDEF(x3_test_with)
FILE: tc/string/spirit/unittest/x3_variant.t.cpp
type none (line 15) | struct none {}
type ast (line 25) | struct ast : variant
method ast (line 30) | ast(char const* s)
method ast (line 34) | ast& operator=(char const* s)
function UNITTESTDEF (line 41) | UNITTESTDEF(x3_test_x3_variant)
FILE: tc/string/spirit/x3/auxiliary/attr.hpp
type boost (line 23) | namespace boost { namespace spirit { namespace x3
type spirit (line 23) | namespace spirit { namespace x3
type x3 (line 23) | namespace x3
type detail (line 26) | namespace detail
type array_helper (line 30) | struct array_helper
type attr_parser (line 46) | struct attr_parser : parser<attr_parser<Value>>
method attr_parser (line 55) | constexpr attr_parser(Value const& value)
method attr_parser (line 57) | constexpr attr_parser(Value&& value)
method parse (line 62) | bool parse(Iterator& /* first */, Iterator const& /* last */
type attr_parser<Value[N]> (line 74) | struct attr_parser<Value[N]> : parser<attr_parser<Value[N]>>
method parse (line 87) | bool parse(Iterator& /* first */, Iterator const& /* last */
type get_info<attr_parser<Value>> (line 97) | struct get_info<attr_parser<Value>>
type attr_gen (line 106) | struct attr_gen
type array_helper<Value, N, std::index_sequence<Is...>> (line 33) | struct array_helper<Value, N, std::index_sequence<Is...>>
method array_helper (line 35) | constexpr array_helper(Value const (&value)[N])
method array_helper (line 38) | constexpr array_helper(Value (&&value)[N])
FILE: tc/string/spirit/x3/auxiliary/eoi.hpp
type boost (line 15) | namespace boost { namespace spirit { namespace x3
type spirit (line 15) | namespace spirit { namespace x3
type x3 (line 15) | namespace x3
type eoi_parser (line 17) | struct eoi_parser : parser<eoi_parser>
method parse (line 23) | bool parse(Iterator& first, Iterator const& last
type get_info<eoi_parser> (line 32) | struct get_info<eoi_parser>
method result_type (line 35) | result_type operator()(eoi_parser const &) const { return "eoi"; }
FILE: tc/string/spirit/x3/auxiliary/eol.hpp
type boost (line 15) | namespace boost { namespace spirit { namespace x3
type spirit (line 15) | namespace spirit { namespace x3
type x3 (line 15) | namespace x3
type eol_parser (line 17) | struct eol_parser : parser<eol_parser>
method parse (line 23) | bool parse(Iterator& first, Iterator const& last
type get_info<eol_parser> (line 46) | struct get_info<eol_parser>
method result_type (line 49) | result_type operator()(eol_parser const &) const { return "eol"; }
FILE: tc/string/spirit/x3/auxiliary/eps.hpp
type boost (line 14) | namespace boost { namespace spirit { namespace x3
type spirit (line 14) | namespace spirit { namespace x3
type x3 (line 14) | namespace x3
type rule_context_tag (line 16) | struct rule_context_tag
type semantic_predicate (line 18) | struct semantic_predicate : parser<semantic_predicate>
method semantic_predicate (line 23) | constexpr semantic_predicate(bool predicate)
method parse (line 27) | bool parse(Iterator& first, Iterator const& last
type lazy_semantic_predicate (line 38) | struct lazy_semantic_predicate : parser<lazy_semantic_predicate<F>>
method lazy_semantic_predicate (line 43) | constexpr lazy_semantic_predicate(F f)
method parse (line 47) | bool parse(Iterator& first, Iterator const& last
type eps_parser (line 57) | struct eps_parser : parser<eps_parser>
method parse (line 64) | bool parse(Iterator& first, Iterator const& last
method semantic_predicate (line 71) | constexpr semantic_predicate operator()(bool predicate) const
FILE: tc/string/spirit/x3/auxiliary/guard.hpp
type boost (line 13) | namespace boost { namespace spirit { namespace x3
type spirit (line 13) | namespace spirit { namespace x3
type x3 (line 13) | namespace x3
type error_handler_result (line 15) | enum class error_handler_result
type guard (line 24) | struct guard : unary_parser<Subject, guard<Subject, Handler>>
method guard (line 29) | constexpr guard(Subject const& subject, Handler handler)
method parse (line 34) | bool parse(Iterator& first, Iterator const& last
FILE: tc/string/spirit/x3/binary/binary.hpp
type boost (line 25) | namespace boost { namespace spirit { namespace x3
type spirit (line 25) | namespace spirit { namespace x3
type x3 (line 25) | namespace x3
type binary_lit_parser (line 28) | struct binary_lit_parser
method binary_lit_parser (line 34) | constexpr binary_lit_parser(T n_)
method parse (line 38) | bool parse(Iterator& first, Iterator const& last
type any_binary_parser (line 62) | struct any_binary_parser : parser<any_binary_parser<T, endian, bit...
method parse (line 70) | bool parse(Iterator& first, Iterator const& last
type get_info<any_binary_parser<T, endian::order::little, bits>> (line 131) | struct get_info<any_binary_parser<T, endian::order::little, bits>>
type get_info<any_binary_parser<T, endian::order::big, bits>> (line 141) | struct get_info<any_binary_parser<T, endian::order::big, bits>>
type get_info<binary_lit_parser<T, endian::order::little, bits>> (line 151) | struct get_info<binary_lit_parser<T, endian::order::little, bits>>
type get_info<binary_lit_parser<T, endian::order::big, bits>> (line 161) | struct get_info<binary_lit_parser<T, endian::order::big, bits>>
FILE: tc/string/spirit/x3/char/any_char.hpp
type boost (line 14) | namespace boost { namespace spirit { namespace x3
type spirit (line 14) | namespace spirit { namespace x3
type x3 (line 14) | namespace x3
type any_char (line 17) | struct any_char : char_parser<any_char<Encoding>>
method test (line 25) | bool test(Char ch_, Context const&) const
FILE: tc/string/spirit/x3/char/char.hpp
type boost (line 16) | namespace boost { namespace spirit { namespace x3
type spirit (line 16) | namespace spirit { namespace x3
type x3 (line 16) | namespace x3
type standard (line 18) | namespace standard
function lit (line 23) | constexpr literal_char<char_encoding::standard, unused_type>
function lit (line 29) | constexpr literal_char<char_encoding::standard, unused_type>
type standard_wide (line 42) | namespace standard_wide
function lit (line 47) | constexpr literal_char<char_encoding::standard_wide, unused_type>
type ascii (line 55) | namespace ascii
function lit (line 60) | constexpr literal_char<char_encoding::ascii, unused_type>
function lit (line 66) | constexpr literal_char<char_encoding::ascii, unused_type>
type iso8859_1 (line 73) | namespace iso8859_1
function lit (line 78) | constexpr literal_char<char_encoding::iso8859_1, unused_type>
function lit (line 84) | constexpr literal_char<char_encoding::iso8859_1, unused_type>
FILE: tc/string/spirit/x3/char/char_class.hpp
type boost (line 17) | namespace boost { namespace spirit { namespace x3
type spirit (line 17) | namespace spirit { namespace x3
type x3 (line 17) | namespace x3
type char_class_base (line 21) | struct char_class_base
type char_class (line 54) | struct char_class
method test (line 64) | bool test(Char ch, Context const& context) const
FILE: tc/string/spirit/x3/char/char_class_tags.hpp
type boost (line 11) | namespace boost { namespace spirit { namespace x3
type spirit (line 11) | namespace spirit { namespace x3
type x3 (line 11) | namespace x3
type char_tag (line 14) | struct char_tag {}
type alnum_tag (line 15) | struct alnum_tag {}
type alpha_tag (line 16) | struct alpha_tag {}
type blank_tag (line 17) | struct blank_tag {}
type cntrl_tag (line 18) | struct cntrl_tag {}
type digit_tag (line 19) | struct digit_tag {}
type graph_tag (line 20) | struct graph_tag {}
type print_tag (line 21) | struct print_tag {}
type punct_tag (line 22) | struct punct_tag {}
type space_tag (line 23) | struct space_tag {}
type xdigit_tag (line 24) | struct xdigit_tag {}
type lower_tag (line 25) | struct lower_tag {}
type upper_tag (line 26) | struct upper_tag {}
FILE: tc/string/spirit/x3/char/char_parser.hpp
type boost (line 15) | namespace boost { namespace spirit { namespace x3
type spirit (line 15) | namespace spirit { namespace x3
type x3 (line 15) | namespace x3
type char_parser (line 21) | struct char_parser : parser<Derived>
method parse (line 24) | bool parse(
FILE: tc/string/spirit/x3/char/char_set.hpp
type boost (line 19) | namespace boost { namespace spirit { namespace x3
type spirit (line 19) | namespace spirit { namespace x3
type x3 (line 19) | namespace x3
type char_range (line 25) | struct char_range
method char_range (line 36) | constexpr char_range(char_type from_, char_type to_)
method test (line 40) | bool test(Char ch_, Context const& context) const
type char_set (line 56) | struct char_set : char_parser<char_set<Encoding, Attribute>>
method char_set (line 65) | char_set(String const& str)
method test (line 97) | bool test(Char ch_, Context const& context) const
type get_info<char_set<Encoding, Attribute>> (line 106) | struct get_info<char_set<Encoding, Attribute>>
type get_info<char_range<Encoding, Attribute>> (line 116) | struct get_info<char_range<Encoding, Attribute>>
FILE: tc/string/spirit/x3/char/detail/cast_char.hpp
type boost (line 15) | namespace boost { namespace spirit { namespace x3 { namespace detail
type spirit (line 15) | namespace spirit { namespace x3 { namespace detail
type x3 (line 15) | namespace x3 { namespace detail
type detail (line 15) | namespace detail
function TargetChar (line 27) | TargetChar cast_char(SourceChar ch)
FILE: tc/string/spirit/x3/char/literal_char.hpp
type boost (line 14) | namespace boost { namespace spirit { namespace x3
type spirit (line 14) | namespace spirit { namespace x3
type x3 (line 14) | namespace x3
type literal_char (line 17) | struct literal_char : char_parser<literal_char<Encoding, Attribute>>
method literal_char (line 26) | constexpr literal_char(Char ch)
method test (line 30) | bool test(Char ch_, Context const& context) const
type get_info<literal_char<Encoding, Attribute>> (line 39) | struct get_info<literal_char<Encoding, Attribute>>
FILE: tc/string/spirit/x3/char/negated_char_parser.hpp
type boost (line 14) | namespace boost { namespace spirit { namespace x3
type spirit (line 14) | namespace spirit { namespace x3
type x3 (line 14) | namespace x3
type negated_char_parser (line 20) | struct negated_char_parser :
method negated_char_parser (line 23) | constexpr negated_char_parser(Positive const& positive)
method test (line 27) | bool test(CharParam ch, Context const& context) const
function Positive (line 43) | constexpr Positive const&
type traits (line 50) | namespace traits
type attribute_of<x3::negated_char_parser<Positive>, Context> (line 53) | struct attribute_of<x3::negated_char_parser<Positive>, Context>
type has_attribute<x3::negated_char_parser<Positive>, Context> (line 57) | struct has_attribute<x3::negated_char_parser<Positive>, Context>
type x3 (line 50) | namespace x3 { namespace traits
type negated_char_parser (line 20) | struct negated_char_parser :
method negated_char_parser (line 23) | constexpr negated_char_parser(Positive const& positive)
method test (line 27) | bool test(CharParam ch, Context const& context) const
function Positive (line 43) | constexpr Positive const&
type traits (line 50) | namespace traits
type attribute_of<x3::negated_char_parser<Positive>, Context> (line 53) | struct attribute_of<x3::negated_char_parser<Positive>, Context>
type has_attribute<x3::negated_char_parser<Positive>, Context> (line 57) | struct has_attribute<x3::negated_char_parser<Positive>, Context>
type spirit (line 50) | namespace spirit { namespace x3 { namespace traits
type x3 (line 14) | namespace x3
type negated_char_parser (line 20) | struct negated_char_parser :
method negated_char_parser (line 23) | constexpr negated_char_parser(Positive const& positive)
method test (line 27) | bool test(CharParam ch, Context const& context) const
function Positive (line 43) | constexpr Positive const&
type traits (line 50) | namespace traits
type attribute_of<x3::negated_char_parser<Positive>, Context> (line 53) | struct attribute_of<x3::negated_char_parser<Positive>, Context>
type has_attribute<x3::negated_char_parser<Positive>, Context> (line 57) | struct has_attribute<x3::negated_char_parser<Positive>, Context>
type x3 (line 50) | namespace x3 { namespace traits
type negated_char_parser (line 20) | struct negated_char_parser :
method negated_char_parser (line 23) | constexpr negated_char_parser(Positive const& positive)
method test (line 27) | bool test(CharParam ch, Context const& context) const
function Positive (line 43) | constexpr Positive const&
type traits (line 50) | namespace traits
type attribute_of<x3::negated_char_parser<Positive>, Context> (line 53) | struct attribute_of<x3::negated_char_parser<Positive>, Context>
type has_attribute<x3::negated_char_parser<Positive>, Context> (line 57) | struct has_attribute<x3::negated_char_parser<Positive>, Context>
type boost (line 50) | namespace boost { namespace spirit { namespace x3 { namespace traits
type spirit (line 14) | namespace spirit { namespace x3
type x3 (line 14) | namespace x3
type negated_char_parser (line 20) | struct negated_char_parser :
method negated_char_parser (line 23) | constexpr negated_char_parser(Positive const& positive)
method test (line 27) | bool test(CharParam ch, Context const& context) const
function Positive (line 43) | constexpr Positive const&
type traits (line 50) | namespace traits
type attribute_of<x3::negated_char_parser<Positive>, Context> (line 53) | struct attribute_of<x3::negated_char_parser<Positive>, Context>
type has_attribute<x3::negated_char_parser<Positive>, Context> (line 57) | struct has_attribute<x3::negated_char_parser<Positive>, Context>
type x3 (line 50) | namespace x3 { namespace traits
type negated_char_parser (line 20) | struct negated_char_parser :
method negated_char_parser (line 23) | constexpr negated_char_parser(Positive const& positive)
method test (line 27) | bool test(CharParam ch, Context const& context) const
function Positive (line 43) | constexpr Positive const&
type traits (line 50) | namespace traits
type attribute_of<x3::negated_char_parser<Positive>, Context> (line 53) | struct attribute_of<x3::negated_char_parser<Positive>, Context>
type has_attribute<x3::negated_char_parser<Positive>, Context> (line 57) | struct has_attribute<x3::negated_char_parser<Positive>, Context>
type spirit (line 50) | namespace spirit { namespace x3 { namespace traits
type x3 (line 14) | namespace x3
type negated_char_parser (line 20) | struct negated_char_parser :
method negated_char_parser (line 23) | constexpr negated_char_parser(Positive const& positive)
method test (line 27) | bool test(CharParam ch, Context const& context) const
function Positive (line 43) | constexpr Positive const&
type traits (line 50) | namespace traits
type attribute_of<x3::negated_char_parser<Positive>, Context> (line 53) | struct attribute_of<x3::negated_char_parser<Positive>, Context>
type has_attribute<x3::negated_char_parser<Positive>, Context> (line 57) | struct has_attribute<x3::negated_char_parser<Positive>, Context>
type x3 (line 50) | namespace x3 { namespace traits
type negated_char_parser (line 20) | struct negated_char_parser :
method negated_char_parser (line 23) | constexpr negated_char_parser(Positive const& positive)
method test (line 27) | bool test(CharParam ch, Context const& context) const
function Positive (line 43) | constexpr Positive const&
type traits (line 50) | namespace traits
type attribute_of<x3::negated_char_parser<Positive>, Context> (line 53) | struct attribute_of<x3::negated_char_parser<Positive>, Context>
type has_attribute<x3::negated_char_parser<Positive>, Context> (line 57) | struct has_attribute<x3::negated_char_parser<Positive>, Context>
FILE: tc/string/spirit/x3/char/unicode.hpp
type boost (line 15) | namespace boost { namespace spirit { namespace x3
type spirit (line 15) | namespace spirit { namespace x3
type x3 (line 15) | namespace x3
type char_tag (line 20) | struct char_tag
type alnum_tag (line 21) | struct alnum_tag
type alpha_tag (line 22) | struct alpha_tag
type blank_tag (line 23) | struct blank_tag
type cntrl_tag (line 24) | struct cntrl_tag
type digit_tag (line 25) | struct digit_tag
type graph_tag (line 26) | struct graph_tag
type print_tag (line 27) | struct print_tag
type punct_tag (line 28) | struct punct_tag
type space_tag (line 29) | struct space_tag
type xdigit_tag (line 30) | struct xdigit_tag
type lower_tag (line 31) | struct lower_tag
type upper_tag (line 32) | struct upper_tag
type letter_tag (line 37) | struct letter_tag {}
type mark_tag (line 38) | struct mark_tag {}
type number_tag (line 39) | struct number_tag {}
type separator_tag (line 40) | struct separator_tag {}
type other_tag (line 41) | struct other_tag {}
type punctuation_tag (line 42) | struct punctuation_tag {}
type symbol_tag (line 43) | struct symbol_tag {}
type uppercase_letter_tag (line 48) | struct uppercase_letter_tag {}
type lowercase_letter_tag (line 49) | struct lowercase_letter_tag {}
type titlecase_letter_tag (line 50) | struct titlecase_letter_tag {}
type modifier_letter_tag (line 51) | struct modifier_letter_tag {}
type other_letter_tag (line 52) | struct other_letter_tag {}
type nonspacing_mark_tag (line 54) | struct nonspacing_mark_tag {}
type enclosing_mark_tag (line 55) | struct enclosing_mark_tag {}
type spacing_mark_tag (line 56) | struct spacing_mark_tag {}
type decimal_number_tag (line 58) | struct decimal_number_tag {}
type letter_number_tag (line 59) | struct letter_number_tag {}
type other_number_tag (line 60) | struct other_number_tag {}
type space_separator_tag (line 62) | struct space_separator_tag {}
type line_separator_tag (line 63) | struct line_separator_tag {}
type paragraph_separator_tag (line 64) | struct paragraph_separator_tag {}
type control_tag (line 66) | struct control_tag {}
type format_tag (line 67) | struct format_tag {}
type private_use_tag (line 68) | struct private_use_tag {}
type surrogate_tag (line 69) | struct surrogate_tag {}
type unassigned_tag (line 70) | struct unassigned_tag {}
type dash_punctuation_tag (line 72) | struct dash_punctuation_tag {}
type open_punctuation_tag (line 73) | struct open_punctuation_tag {}
type close_punctuation_tag (line 74) | struct close_punctuation_tag {}
type connector_punctuation_tag (line 75) | struct connector_punctuation_tag {}
type other_punctuation_tag (line 76) | struct other_punctuation_tag {}
type initial_punctuation_tag (line 77) | struct initial_punctuation_tag {}
type final_punctuation_tag (line 78) | struct final_punctuation_tag {}
type math_symbol_tag (line 80) | struct math_symbol_tag {}
type currency_symbol_tag (line 81) | struct currency_symbol_tag {}
type modifier_symbol_tag (line 82) | struct modifier_symbol_tag {}
type other_symbol_tag (line 83) | struct other_symbol_tag {}
type alphabetic_tag (line 88) | struct alphabetic_tag {}
type uppercase_tag (line 89) | struct uppercase_tag {}
type lowercase_tag (line 90) | struct lowercase_tag {}
type white_space_tag (line 91) | struct white_space_tag {}
type hex_digit_tag (line 92) | struct hex_digit_tag {}
type noncharacter_code_point_tag (line 93) | struct noncharacter_code_point_tag {}
type default_ignorable_code_point_tag (line 94) | struct default_ignorable_code_point_tag {}
type adlam_tag (line 99) | struct adlam_tag {}
type caucasian_albanian_tag (line 100) | struct caucasian_albanian_tag {}
type ahom_tag (line 101) | struct ahom_tag {}
type arabic_tag (line 102) | struct arabic_tag {}
type imperial_aramaic_tag (line 103) | struct imperial_aramaic_tag {}
type armenian_tag (line 104) | struct armenian_tag {}
type avestan_tag (line 105) | struct avestan_tag {}
type balinese_tag (line 106) | struct balinese_tag {}
type bamum_tag (line 107) | struct bamum_tag {}
type bassa_vah_tag (line 108) | struct bassa_vah_tag {}
type batak_tag (line 109) | struct batak_tag {}
type bengali_tag (line 110) | struct bengali_tag {}
type bhaiksuki_tag (line 111) | struct bhaiksuki_tag {}
type bopomofo_tag (line 112) | struct bopomofo_tag {}
type brahmi_tag (line 113) | struct brahmi_tag {}
type braille_tag (line 114) | struct braille_tag {}
type buginese_tag (line 115) | struct buginese_tag {}
type buhid_tag (line 116) | struct buhid_tag {}
type chakma_tag (line 117) | struct chakma_tag {}
type canadian_aboriginal_tag (line 118) | struct canadian_aboriginal_tag {}
type carian_tag (line 119) | struct carian_tag {}
type cham_tag (line 120) | struct cham_tag {}
type cherokee_tag (line 121) | struct cherokee_tag {}
type chorasmian_tag (line 122) | struct chorasmian_tag {}
type coptic_tag (line 123) | struct coptic_tag {}
type cypro_minoan_tag (line 124) | struct cypro_minoan_tag {}
type cypriot_tag (line 125) | struct cypriot_tag {}
type cyrillic_tag (line 126) | struct cyrillic_tag {}
type devanagari_tag (line 127) | struct devanagari_tag {}
type dives_akuru_tag (line 128) | struct dives_akuru_tag {}
type dogra_tag (line 129) | struct dogra_tag {}
type deseret_tag (line 130) | struct deseret_tag {}
type duployan_tag (line 131) | struct duployan_tag {}
type egyptian_hieroglyphs_tag (line 132) | struct egyptian_hieroglyphs_tag {}
type elbasan_tag (line 133) | struct elbasan_tag {}
type elymaic_tag (line 134) | struct elymaic_tag {}
type ethiopic_tag (line 135) | struct ethiopic_tag {}
type georgian_tag (line 136) | struct georgian_tag {}
type glagolitic_tag (line 137) | struct glagolitic_tag {}
type gunjala_gondi_tag (line 138) | struct gunjala_gondi_tag {}
type masaram_gondi_tag (line 139) | struct masaram_gondi_tag {}
type gothic_tag (line 140) | struct gothic_tag {}
type grantha_tag (line 141) | struct grantha_tag {}
type greek_tag (line 142) | struct greek_tag {}
type gujarati_tag (line 143) | struct gujarati_tag {}
type gurmukhi_tag (line 144) | struct gurmukhi_tag {}
type hangul_tag (line 145) | struct hangul_tag {}
type han_tag (line 146) | struct han_tag {}
type hanunoo_tag (line 147) | struct hanunoo_tag {}
type hatran_tag (line 148) | struct hatran_tag {}
type hebrew_tag (line 149) | struct hebrew_tag {}
type hiragana_tag (line 150) | struct hiragana_tag {}
type anatolian_hieroglyphs_tag (line 151) | struct anatolian_hieroglyphs_tag {}
type pahawh_hmong_tag (line 152) | struct pahawh_hmong_tag {}
type nyiakeng_puachue_hmong_tag (line 153) | struct nyiakeng_puachue_hmong_tag {}
type katakana_or_hiragana_tag (line 154) | struct katakana_or_hiragana_tag {}
type old_hungarian_tag (line 155) | struct old_hungarian_tag {}
type old_italic_tag (line 156) | struct old_italic_tag {}
type javanese_tag (line 157) | struct javanese_tag {}
type kayah_li_tag (line 158) | struct kayah_li_tag {}
type katakana_tag (line 159) | struct katakana_tag {}
type kawi_tag (line 160) | struct kawi_tag {}
type kharoshthi_tag (line 161) | struct kharoshthi_tag {}
type khmer_tag (line 162) | struct khmer_tag {}
type khojki_tag (line 163) | struct khojki_tag {}
type khitan_small_script_tag (line 164) | struct khitan_small_script_tag {}
type kannada_tag (line 165) | struct kannada_tag {}
type kaithi_tag (line 166) | struct kaithi_tag {}
type tai_tham_tag (line 167) | struct tai_tham_tag {}
type lao_tag (line 168) | struct lao_tag {}
type latin_tag (line 169) | struct latin_tag {}
type lepcha_tag (line 170) | struct lepcha_tag {}
type limbu_tag (line 171) | struct limbu_tag {}
type linear_a_tag (line 172) | struct linear_a_tag {}
type linear_b_tag (line 173) | struct linear_b_tag {}
type lisu_tag (line 174) | struct lisu_tag {}
type lycian_tag (line 175) | struct lycian_tag {}
type lydian_tag (line 176) | struct lydian_tag {}
type mahajani_tag (line 177) | struct mahajani_tag {}
type makasar_tag (line 178) | struct makasar_tag {}
type mandaic_tag (line 179) | struct mandaic_tag {}
type manichaean_tag (line 180) | struct manichaean_tag {}
type marchen_tag (line 181) | struct marchen_tag {}
type medefaidrin_tag (line 182) | struct medefaidrin_tag {}
type mende_kikakui_tag (line 183) | struct mende_kikakui_tag {}
type meroitic_cursive_tag (line 184) | struct meroitic_cursive_tag {}
type meroitic_hieroglyphs_tag (line 185) | struct meroitic_hieroglyphs_tag {}
type malayalam_tag (line 186) | struct malayalam_tag {}
type modi_tag (line 187) | struct modi_tag {}
type mongolian_tag (line 188) | struct mongolian_tag {}
type mro_tag (line 189) | struct mro_tag {}
type meetei_mayek_tag (line 190) | struct meetei_mayek_tag {}
type multani_tag (line 191) | struct multani_tag {}
type myanmar_tag (line 192) | struct myanmar_tag {}
type nag_mundari_tag (line 193) | struct nag_mundari_tag {}
type nandinagari_tag (line 194) | struct nandinagari_tag {}
type old_north_arabian_tag (line 195) | struct old_north_arabian_tag {}
type nabataean_tag (line 196) | struct nabataean_tag {}
type newa_tag (line 197) | struct newa_tag {}
type nko_tag (line 198) | struct nko_tag {}
type nushu_tag (line 199) | struct nushu_tag {}
type ogham_tag (line 200) | struct ogham_tag {}
type ol_chiki_tag (line 201) | struct ol_chiki_tag {}
type old_turkic_tag (line 202) | struct old_turkic_tag {}
type oriya_tag (line 203) | struct oriya_tag {}
type osage_tag (line 204) | struct osage_tag {}
type osmanya_tag (line 205) | struct osmanya_tag {}
type old_uyghur_tag (line 206) | struct old_uyghur_tag {}
type palmyrene_tag (line 207) | struct palmyrene_tag {}
type pau_cin_hau_tag (line 208) | struct pau_cin_hau_tag {}
type old_permic_tag (line 209) | struct old_permic_tag {}
type phags_pa_tag (line 210) | struct phags_pa_tag {}
type inscriptional_pahlavi_tag (line 211) | struct inscriptional_pahlavi_tag {}
type psalter_pahlavi_tag (line 212) | struct psalter_pahlavi_tag {}
type phoenician_tag (line 213) | struct phoenician_tag {}
type miao_tag (line 214) | struct miao_tag {}
type inscriptional_parthian_tag (line 215) | struct inscriptional_parthian_tag {}
type rejang_tag (line 216) | struct rejang_tag {}
type hanifi_rohingya_tag (line 217) | struct hanifi_rohingya_tag {}
type runic_tag (line 218) | struct runic_tag {}
type samaritan_tag (line 219) | struct samaritan_tag {}
type old_south_arabian_tag (line 220) | struct old_south_arabian_tag {}
type saurashtra_tag (line 221) | struct saurashtra_tag {}
type signwriting_tag (line 222) | struct signwriting_tag {}
type shavian_tag (line 223) | struct shavian_tag {}
type sharada_tag (line 224) | struct sharada_tag {}
type siddham_tag (line 225) | struct siddham_tag {}
type khudawadi_tag (line 226) | struct khudawadi_tag {}
type sinhala_tag (line 227) | struct sinhala_tag {}
type sogdian_tag (line 228) | struct sogdian_tag {}
type old_sogdian_tag (line 229) | struct old_sogdian_tag {}
type sora_sompeng_tag (line 230) | struct sora_sompeng_tag {}
type soyombo_tag (line 231) | struct soyombo_tag {}
type sundanese_tag (line 232) | struct sundanese_tag {}
type syloti_nagri_tag (line 233) | struct syloti_nagri_tag {}
type syriac_tag (line 234) | struct syriac_tag {}
type tagbanwa_tag (line 235) | struct tagbanwa_tag {}
type takri_tag (line 236) | struct takri_tag {}
type tai_le_tag (line 237) | struct tai_le_tag {}
type new_tai_lue_tag (line 238) | struct new_tai_lue_tag {}
type tamil_tag (line 239) | struct tamil_tag {}
type tangut_tag (line 240) | struct tangut_tag {}
type tai_viet_tag (line 241) | struct tai_viet_tag {}
type telugu_tag (line 242) | struct telugu_tag {}
type tifinagh_tag (line 243) | struct tifinagh_tag {}
type tagalog_tag (line 244) | struct tagalog_tag {}
type thaana_tag (line 245) | struct thaana_tag {}
type thai_tag (line 246) | struct thai_tag {}
type tibetan_tag (line 247) | struct tibetan_tag {}
type tirhuta_tag (line 248) | struct tirhuta_tag {}
type tangsa_tag (line 249) | struct tangsa_tag {}
type toto_tag (line 250) | struct toto_tag {}
type ugaritic_tag (line 251) | struct ugaritic_tag {}
type vai_tag (line 252) | struct vai_tag {}
type vithkuqi_tag (line 253) | struct vithkuqi_tag {}
type warang_citi_tag (line 254) | struct warang_citi_tag {}
type wancho_tag (line 255) | struct wancho_tag {}
type old_persian_tag (line 256) | struct old_persian_tag {}
type cuneiform_tag (line 257) | struct cuneiform_tag {}
type yezidi_tag (line 258) | struct yezidi_tag {}
type yi_tag (line 259) | struct yi_tag {}
type zanabazar_square_tag (line 260) | struct zanabazar_square_tag {}
type inherited_tag (line 261) | struct inherited_tag {}
type common_tag (line 262) | struct common_tag {}
type unknown_tag (line 263) | struct unknown_tag {}
type unicode_char_class_base (line 266) | struct unicode_char_class_base
type unicode_char_class (line 547) | struct unicode_char_class
method test (line 557) | bool test(Char ch, Context const&) const
type unicode (line 568) | namespace unicode
FILE: tc/string/spirit/x3/core/action.hpp
type boost (line 16) | namespace boost { namespace spirit { namespace x3
type spirit (line 16) | namespace spirit { namespace x3
type x3 (line 16) | namespace x3
type raw_attribute_type (line 18) | struct raw_attribute_type
type parse_pass_context_tag (line 19) | struct parse_pass_context_tag
type action (line 28) | struct action : unary_parser<Subject, action<Subject, Action>>
method action (line 34) | constexpr action(Subject const& subject, Action f)
method call_action (line 38) | bool call_action(
method parse_main (line 50) | bool parse_main(Iterator& first, Iterator const& last
method parse_main (line 68) | bool parse_main(Iterator& first, Iterator const& last
method parse (line 78) | bool parse(Iterator& first, Iterator const& last
method parse (line 93) | bool parse(Iterator& first, Iterator const& last
FILE: tc/string/spirit/x3/core/call.hpp
type boost (line 16) | namespace boost { namespace spirit { namespace x3
type spirit (line 16) | namespace spirit { namespace x3
type x3 (line 16) | namespace x3
type rule_val_context_tag (line 19) | struct rule_val_context_tag
function _val (line 22) | inline decltype(auto) _val(Context const& context)
type where_context_tag (line 28) | struct where_context_tag
function _where (line 31) | inline decltype(auto) _where(Context const& context)
type attr_context_tag (line 37) | struct attr_context_tag
function _attr (line 40) | inline decltype(auto) _attr(Context const& context)
type detail (line 46) | namespace detail
function call (line 49) | auto call(F f, Context const& context, mpl::true_)
function call (line 55) | auto call(F f, Context const& /* context */, mpl::false_)
function call (line 64) | auto call(
FILE: tc/string/spirit/x3/core/detail/parse_into_container.hpp
type boost (line 26) | namespace boost { namespace spirit { namespace x3 { namespace detail
type spirit (line 26) | namespace spirit { namespace x3 { namespace detail
type x3 (line 26) | namespace x3 { namespace detail
type detail (line 26) | namespace detail
type saver_visitor (line 29) | struct saver_visitor
method saver_visitor (line 59) | saver_visitor(Attribute& attr, Value& value)
type save_to_assoc_attr (line 33) | struct save_to_assoc_attr
method call (line 36) | static void call(const Key, Value& value, Attribute& attr)
type saver_visitor (line 57) | struct saver_visitor : boost::static_visitor<void>
method saver_visitor (line 59) | saver_visitor(Attribute& attr, Value& value)
type parser_accepts_container (line 73) | struct parser_accepts_container
type parse_into_container_base_impl (line 81) | struct parse_into_container_base_impl
method call_synthesize_x (line 88) | static bool call_synthesize_x(
method call_synthesize_x (line 108) | static bool call_synthesize_x(
method call_synthesize (line 119) | static bool call_synthesize(
method call_synthesize_into_fusion_seq (line 135) | static bool call_synthesize_into_fusion_seq(Parser const& parser
method call_synthesize_into_fusion_seq (line 147) | static bool call_synthesize_into_fusion_seq(
method call_synthesize_dispatch_by_seq (line 169) | static bool call_synthesize_dispatch_by_seq(Parser const& parser
method call_synthesize_dispatch_by_seq (line 179) | static bool call_synthesize_dispatch_by_seq(Parser const& parser
method call (line 188) | static bool call(Parser const& parser
method call (line 198) | static bool call(
method call (line 210) | static bool call(Parser const& parser
type parse_into_container_impl (line 220) | struct parse_into_container_impl : parse_into_container_base_imp...
type parser_attr_is_substitute_for_container_value (line 223) | struct parser_attr_is_substitute_for_container_value
type parse_into_container_impl<Parser, Context, RContext,
typename enable_if<traits::handles_container<Parser, Context>>::type> (line 235) | struct parse_into_container_impl<Parser, Context, RContext,
method call (line 239) | static bool call(
method call (line 249) | static bool call(
method call (line 258) | static bool call(
method call (line 274) | static bool call(Parser const& parser
function parse_into_container (line 298) | bool parse_into_container(
type save_to_assoc_attr<variant<T...> > (line 45) | struct save_to_assoc_attr<variant<T...> >
method call (line 50) | static void call(const variant_t key, Value& value, Attribute& attr)
FILE: tc/string/spirit/x3/core/parse.hpp
type boost (line 15) | namespace boost { namespace spirit { namespace x3
type spirit (line 15) | namespace spirit { namespace x3
type x3 (line 15) | namespace x3
function parse_main (line 19) | inline bool
function parse (line 39) | inline bool
function parse (line 51) | inline bool
function parse (line 64) | inline bool
function parse (line 75) | inline bool
type skip_flag (line 86) | enum class skip_flag
function phrase_parse_main (line 94) | inline bool
function phrase_parse (line 123) | inline bool
function phrase_parse (line 137) | inline bool
function phrase_parse (line 152) | inline bool
function phrase_parse (line 165) | inline bool
type phrase_parse_context (line 179) | struct phrase_parse_context
FILE: tc/string/spirit/x3/core/parser.hpp
type boost (line 28) | namespace boost { namespace spirit { namespace x3
type spirit (line 28) | namespace spirit { namespace x3
type x3 (line 28) | namespace x3
type action (line 31) | struct action
type guard (line 34) | struct guard
type parser_base (line 36) | struct parser_base {}
type parser_id (line 37) | struct parser_id
type parser (line 43) | struct parser : parser_base
method Derived (line 50) | constexpr Derived const& derived() const
method on_error (line 62) | constexpr guard<Derived, Handler> on_error(Handler f) const
type unary_category (line 68) | struct unary_category
type binary_category (line 69) | struct binary_category
type unary_parser (line 72) | struct unary_parser : parser<Derived>
method unary_parser (line 78) | constexpr unary_parser(Subject const& subject)
method unary_parser (line 81) | unary_parser const& get_unary() const { return *this; }
type binary_parser (line 87) | struct binary_parser : parser<Derived>
method binary_parser (line 95) | constexpr binary_parser(Left const& left, Right const& right)
method binary_parser (line 98) | binary_parser const& get_binary() const { return *this; }
type get_info (line 115) | struct get_info
function what (line 129) | std::string what(Parser const& p)
type traits (line 135) | namespace traits
type has_attribute<x3::unary_parser<Subject, Derived>, Context> (line 138) | struct has_attribute<x3::unary_parser<Subject, Derived>, Context>
type has_attribute<x3::binary_parser<Left, Right, Derived>, Context> (line 142) | struct has_attribute<x3::binary_parser<Left, Right, Derived>, Co...
type x3 (line 135) | namespace x3 { namespace traits
type action (line 31) | struct action
type guard (line 34) | struct guard
type parser_base (line 36) | struct parser_base {}
type parser_id (line 37) | struct parser_id
type parser (line 43) | struct parser : parser_base
method Derived (line 50) | constexpr Derived const& derived() const
method on_error (line 62) | constexpr guard<Derived, Handler> on_error(Handler f) const
type unary_category (line 68) | struct unary_category
type binary_category (line 69) | struct binary_category
type unary_parser (line 72) | struct unary_parser : parser<Derived>
method unary_parser (line 78) | constexpr unary_parser(Subject const& subject)
method unary_parser (line 81) | unary_parser const& get_unary() const { return *this; }
type binary_parser (line 87) | struct binary_parser : parser<Derived>
method binary_parser (line 95) | constexpr binary_parser(Left const& left, Right const& right)
method binary_parser (line 98) | binary_parser const& get_binary() const { return *this; }
type get_info (line 115) | struct get_info
function what (line 129) | std::string what(Parser const& p)
type traits (line 135) | namespace traits
type has_attribute<x3::unary_parser<Subject, Derived>, Context> (line 138) | struct has_attribute<x3::unary_parser<Subject, Derived>, Context>
type has_attribute<x3::binary_parser<Left, Right, Derived>, Context> (line 142) | struct has_attribute<x3::binary_parser<Left, Right, Derived>, Co...
type spirit (line 135) | namespace spirit { namespace x3 { namespace traits
type x3 (line 28) | namespace x3
type action (line 31) | struct action
type guard (line 34) | struct guard
type parser_base (line 36) | struct parser_base {}
type parser_id (line 37) | struct parser_id
type parser (line 43) | struct parser : parser_base
method Derived (line 50) | constexpr Derived const& derived() const
method on_error (line 62) | constexpr guard<Derived, Handler> on_error(Handler f) const
type unary_category (line 68) | struct unary_category
type binary_category (line 69) | struct binary_category
type unary_parser (line 72) | struct unary_parser : parser<Derived>
method unary_parser (line 78) | constexpr unary_parser(Subject const& subject)
method unary_parser (line 81) | unary_parser const& get_unary() const { return *this; }
type binary_parser (line 87) | struct binary_parser : parser<Derived>
method binary_parser (line 95) | constexpr binary_parser(Left const& left, Right const& right)
method binary_parser (line 98) | binary_parser const& get_binary() const { return *this; }
type get_info (line 115) | struct get_info
function what (line 129) | std::string what(Parser const& p)
type traits (line 135) | namespace traits
type has_attribute<x3::unary_parser<Subject, Derived>, Context> (line 138) | struct has_attribute<x3::unary_parser<Subject, Derived>, Context>
type has_attribute<x3::binary_parser<Left, Right, Derived>, Context> (line 142) | struct has_attribute<x3::binary_parser<Left, Right, Derived>, Co...
type x3 (line 135) | namespace x3 { namespace traits
type action (line 31) | struct action
type guard (line 34) | struct guard
type parser_base (line 36) | struct parser_base {}
type parser_id (line 37) | struct parser_id
type parser (line 43) | struct parser : parser_base
method Derived (line 50) | constexpr Derived const& derived() const
method on_error (line 62) | constexpr guard<Derived, Handler> on_error(Handler f) const
type unary_category (line 68) | struct unary_category
type binary_category (line 69) | struct binary_category
type unary_parser (line 72) | struct unary_parser : parser<Derived>
method unary_parser (line 78) | constexpr unary_parser(Subject const& subject)
method unary_parser (line 81) | unary_parser const& get_unary() const { return *this; }
type binary_parser (line 87) | struct binary_parser : parser<Derived>
method binary_parser (line 95) | constexpr binary_parser(Left const& left, Right const& right)
method binary_parser (line 98) | binary_parser const& get_binary() const { return *this; }
type get_info (line 115) | struct get_info
function what (line 129) | std::string what(Parser const& p)
type traits (line 135) | namespace traits
type has_attribute<x3::unary_parser<Subject, Derived>, Context> (line 138) | struct has_attribute<x3::unary_parser<Subject, Derived>, Context>
type has_attribute<x3::binary_parser<Left, Right, Derived>, Context> (line 142) | struct has_attribute<x3::binary_parser<Left, Right, Derived>, Co...
type boost (line 135) | namespace boost { namespace spirit { namespace x3 { namespace traits
type spirit (line 28) | namespace spirit { namespace x3
type x3 (line 28) | namespace x3
type action (line 31) | struct action
type guard (line 34) | struct guard
type parser_base (line 36) | struct parser_base {}
type parser_id (line 37) | struct parser_id
type parser (line 43) | struct parser : parser_base
method Derived (line 50) | constexpr Derived const& derived() const
method on_error (line 62) | constexpr guard<Derived, Handler> on_error(Handler f) const
type unary_category (line 68) | struct unary_category
type binary_category (line 69) | struct binary_category
type unary_parser (line 72) | struct unary_parser : parser<Derived>
method unary_parser (line 78) | constexpr unary_parser(Subject const& subject)
method unary_parser (line 81) | unary_parser const& get_unary() const { return *this; }
type binary_parser (line 87) | struct binary_parser : parser<Derived>
method binary_parser (line 95) | constexpr binary_parser(Left const& left, Right const& right)
method binary_parser (line 98) | binary_parser const& get_binary() const { return *this; }
type get_info (line 115) | struct get_info
function what (line 129) | std::string what(Parser const& p)
type traits (line 135) | namespace traits
type has_attribute<x3::unary_parser<Subject, Derived>, Context> (line 138) | struct has_attribute<x3::unary_parser<Subject, Derived>, Context>
type has_attribute<x3::binary_parser<Left, Right, Derived>, Context> (line 142) | struct has_attribute<x3::binary_parser<Left, Right, Derived>, Co...
type x3 (line 135) | namespace x3 { namespace traits
type action (line 31) | struct action
type guard (line 34) | struct guard
type parser_base (line 36) | struct parser_base {}
type parser_id (line 37) | struct parser_id
type parser (line 43) | struct parser : parser_base
method Derived (line 50) | constexpr Derived const& derived() const
method on_error (line 62) | constexpr guard<Derived, Handler> on_error(Handler f) const
type unary_category (line 68) | struct unary_category
type binary_category (line 69) | struct binary_category
type unary_parser (line 72) | struct unary_parser : parser<Derived>
method unary_parser (line 78) | constexpr unary_parser(Subject const& subject)
method unary_parser (line 81) | unary_parser const& get_unary() const { return *this; }
type binary_parser (line 87) | struct binary_parser : parser<Derived>
method binary_parser (line 95) | constexpr binary_parser(Left const& left, Right const& right)
method binary_parser (line 98) | binary_parser const& get_binary() const { return *this; }
type get_info (line 115) | struct get_info
function what (line 129) | std::string what(Parser const& p)
type traits (line 135) | namespace traits
type has_attribute<x3::unary_parser<Subject, Derived>, Context> (line 138) | struct has_attribute<x3::unary_parser<Subject, Derived>, Context>
type has_attribute<x3::binary_parser<Left, Right, Derived>, Context> (line 142) | struct has_attribute<x3::binary_parser<Left, Right, Derived>, Co...
type spirit (line 135) | namespace spirit { namespace x3 { namespace traits
type x3 (line 28) | namespace x3
type action (line 31) | struct action
type guard (line 34) | struct guard
type parser_base (line 36) | struct parser_base {}
type parser_id (line 37) | struct parser_id
type parser (line 43) | struct parser : parser_base
method Derived (line 50) | constexpr Derived const& derived() const
method on_error (line 62) | constexpr guard<Derived, Handler> on_error(Handler f) const
type unary_category (line 68) | struct unary_category
type binary_category (line 69) | struct binary_category
type unary_parser (line 72) | struct unary_parser : parser<Derived>
method unary_parser (line 78) | constexpr unary_parser(Subject const& subject)
method unary_parser (line 81) | unary_parser const& get_unary() const { return *this; }
type binary_parser (line 87) | struct binary_parser : parser<Derived>
method binary_parser (line 95) | constexpr binary_parser(Left const& left, Right const& right)
method binary_parser (line 98) | binary_parser const& get_binary() const { return *this; }
type get_info (line 115) | struct get_info
function what (line 129) | std::string what(Parser const& p)
type traits (line 135) | namespace traits
type has_attribute<x3::unary_parser<Subject, Derived>, Context> (line 138) | struct has_attribute<x3::unary_parser<Subject, Derived>, Context>
type has_attribute<x3::binary_parser<Left, Right, Derived>, Context> (line 142) | struct has_attribute<x3::binary_parser<Left, Right, Derived>, Co...
type x3 (line 135) | namespace x3 { namespace traits
type action (line 31) | struct action
type guard (line 34) | struct guard
type parser_base (line 36) | struct parser_base {}
type parser_id (line 37) | struct parser_id
type parser (line 43) | struct parser : parser_base
method Derived (line 50) | constexpr Derived const& derived() const
method on_error (line 62) | constexpr guard<Derived, Handler> on_error(Handler f) const
type unary_category (line 68) | struct unary_category
type binary_category (line 69) | struct binary_category
type unary_parser (line 72) | struct unary_parser : parser<Derived>
method unary_parser (line 78) | constexpr unary_parser(Subject const& subject)
method unary_parser (line 81) | unary_parser const& get_unary() const { return *this; }
type binary_parser (line 87) | struct binary_parser : parser<Derived>
method binary_parser (line 95) | constexpr binary_parser(Left const& left, Right const& right)
method binary_parser (line 98) | binary_parser const& get_binary() const { return *this; }
type get_info (line 115) | struct get_info
function what (line 129) | std::string what(Parser const& p)
type traits (line 135) | namespace traits
type has_attribute<x3::unary_parser<Subject, Derived>, Context> (line 138) | struct has_attribute<x3::unary_parser<Subject, Derived>, Context>
type has_attribute<x3::binary_parser<Left, Right, Derived>, Context> (line 142) | struct has_attribute<x3::binary_parser<Left, Right, Derived>, Co...
FILE: tc/string/spirit/x3/core/proxy.hpp
type boost (line 15) | namespace boost { namespace spirit { namespace x3
type spirit (line 15) | namespace spirit { namespace x3
type x3 (line 15) | namespace x3
type proxy (line 18) | struct proxy : unary_parser<Subject, Derived>
method proxy (line 22) | constexpr proxy(Subject const& subject)
method parse_subject (line 29) | bool parse_subject(Iterator& first, Iterator const& last
method parse (line 39) | bool parse(Iterator& first, Iterator const& last
FILE: tc/string/spirit/x3/core/skip_over.hpp
type boost (line 20) | namespace boost { namespace spirit { namespace x3
type spirit (line 20) | namespace spirit { namespace x3
type x3 (line 20) | namespace x3
type expectation_failure_tag (line 22) | struct expectation_failure_tag
type BOOST_SYMBOL_VISIBLE (line 25) | struct BOOST_SYMBOL_VISIBLE
function which (line 35) | std::string which() const { return which_; }
function Iterator (line 36) | Iterator const& where() const { return where_; }
type unused_skipper (line 49) | struct unused_skipper : unused_type
method unused_skipper (line 51) | unused_skipper(Skipper const& skipper)
type detail (line 56) | namespace detail
type is_unused_skipper (line 59) | struct is_unused_skipper
type is_unused_skipper<unused_skipper<Skipper>> (line 63) | struct is_unused_skipper<unused_skipper<Skipper>>
type is_unused_skipper<unused_type> (line 67) | struct is_unused_skipper<unused_type>
function Skipper (line 71) | inline Skipper const&
function Skipper (line 77) | inline Skipper const&
function skip_over (line 84) | inline void skip_over(
function skip_over (line 93) | inline void skip_over(Iterator&, Iterator const&, unused_type)
function skip_over (line 98) | inline void skip_over(
type skipper_tag (line 105) | struct skipper_tag
type has_skipper (line 108) | struct has_skipper
function skip_over (line 116) | inline void skip_over(
FILE: tc/string/spirit/x3/directive/confix.hpp
type boost (line 14) | namespace boost { namespace spirit { namespace x3
type spirit (line 14) | namespace spirit { namespace x3
type x3 (line 14) | namespace x3
type confix_directive (line 17) | struct confix_directive :
method confix_directive (line 25) | constexpr confix_directive(Prefix const& prefix
method parse (line 36) | bool parse(
type confix_gen (line 58) | struct confix_gen
function confix (line 74) | constexpr confix_gen<Prefix, Postfix>
FILE: tc/string/spirit/x3/directive/expect.hpp
type boost (line 18) | namespace boost { namespace spirit { namespace x3
type spirit (line 18) | namespace spirit { namespace x3
type x3 (line 18) | namespace x3
type detail (line 20) | namespace detail {
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
function has_expectation_failure (line 80) | bool has_expectation_failure(Context const& context) {
function set_expectation_failure (line 86) | void set_expectation_failure(
function get_expectation_failure (line 99) | decltype(auto) get_expectation_failure(
function reset_expectation_failure (line 108) | void reset_expectation_failure(Context const& context) {
type expect_directive (line 114) | struct expect_directive : unary_parser<Subject, expect_directive<S...
method expect_directive (line 119) | constexpr expect_directive(Subject const& subject)
method parse (line 124) | bool parse(Iterator& first, Iterator const& last
type expect_gen (line 140) | struct expect_gen
type detail (line 153) | namespace detail
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
type x3 (line 153) | namespace x3 { namespace detail
type detail (line 20) | namespace detail {
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
function has_expectation_failure (line 80) | bool has_expectation_failure(Context const& context) {
function set_expectation_failure (line 86) | void set_expectation_failure(
function get_expectation_failure (line 99) | decltype(auto) get_expectation_failure(
function reset_expectation_failure (line 108) | void reset_expectation_failure(Context const& context) {
type expect_directive (line 114) | struct expect_directive : unary_parser<Subject, expect_directive<S...
method expect_directive (line 119) | constexpr expect_directive(Subject const& subject)
method parse (line 124) | bool parse(Iterator& first, Iterator const& last
type expect_gen (line 140) | struct expect_gen
type detail (line 153) | namespace detail
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
type spirit (line 153) | namespace spirit { namespace x3 { namespace detail
type x3 (line 18) | namespace x3
type detail (line 20) | namespace detail {
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
function has_expectation_failure (line 80) | bool has_expectation_failure(Context const& context) {
function set_expectation_failure (line 86) | void set_expectation_failure(
function get_expectation_failure (line 99) | decltype(auto) get_expectation_failure(
function reset_expectation_failure (line 108) | void reset_expectation_failure(Context const& context) {
type expect_directive (line 114) | struct expect_directive : unary_parser<Subject, expect_directive<S...
method expect_directive (line 119) | constexpr expect_directive(Subject const& subject)
method parse (line 124) | bool parse(Iterator& first, Iterator const& last
type expect_gen (line 140) | struct expect_gen
type detail (line 153) | namespace detail
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
type x3 (line 153) | namespace x3 { namespace detail
type detail (line 20) | namespace detail {
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
function has_expectation_failure (line 80) | bool has_expectation_failure(Context const& context) {
function set_expectation_failure (line 86) | void set_expectation_failure(
function get_expectation_failure (line 99) | decltype(auto) get_expectation_failure(
function reset_expectation_failure (line 108) | void reset_expectation_failure(Context const& context) {
type expect_directive (line 114) | struct expect_directive : unary_parser<Subject, expect_directive<S...
method expect_directive (line 119) | constexpr expect_directive(Subject const& subject)
method parse (line 124) | bool parse(Iterator& first, Iterator const& last
type expect_gen (line 140) | struct expect_gen
type detail (line 153) | namespace detail
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
type boost (line 153) | namespace boost { namespace spirit { namespace x3 { namespace detail
type spirit (line 18) | namespace spirit { namespace x3
type x3 (line 18) | namespace x3
type detail (line 20) | namespace detail {
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
function has_expectation_failure (line 80) | bool has_expectation_failure(Context const& context) {
function set_expectation_failure (line 86) | void set_expectation_failure(
function get_expectation_failure (line 99) | decltype(auto) get_expectation_failure(
function reset_expectation_failure (line 108) | void reset_expectation_failure(Context const& context) {
type expect_directive (line 114) | struct expect_directive : unary_parser<Subject, expect_directive<S...
method expect_directive (line 119) | constexpr expect_directive(Subject const& subject)
method parse (line 124) | bool parse(Iterator& first, Iterator const& last
type expect_gen (line 140) | struct expect_gen
type detail (line 153) | namespace detail
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
type x3 (line 153) | namespace x3 { namespace detail
type detail (line 20) | namespace detail {
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
function has_expectation_failure (line 80) | bool has_expectation_failure(Context const& context) {
function set_expectation_failure (line 86) | void set_expectation_failure(
function get_expectation_failure (line 99) | decltype(auto) get_expectation_failure(
function reset_expectation_failure (line 108) | void reset_expectation_failure(Context const& context) {
type expect_directive (line 114) | struct expect_directive : unary_parser<Subject, expect_directive<S...
method expect_directive (line 119) | constexpr expect_directive(Subject const& subject)
method parse (line 124) | bool parse(Iterator& first, Iterator const& last
type expect_gen (line 140) | struct expect_gen
type detail (line 153) | namespace detail
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
type spirit (line 153) | namespace spirit { namespace x3 { namespace detail
type x3 (line 18) | namespace x3
type detail (line 20) | namespace detail {
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
function has_expectation_failure (line 80) | bool has_expectation_failure(Context const& context) {
function set_expectation_failure (line 86) | void set_expectation_failure(
function get_expectation_failure (line 99) | decltype(auto) get_expectation_failure(
function reset_expectation_failure (line 108) | void reset_expectation_failure(Context const& context) {
type expect_directive (line 114) | struct expect_directive : unary_parser<Subject, expect_directive<S...
method expect_directive (line 119) | constexpr expect_directive(Subject const& subject)
method parse (line 124) | bool parse(Iterator& first, Iterator const& last
type expect_gen (line 140) | struct expect_gen
type detail (line 153) | namespace detail
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
type x3 (line 153) | namespace x3 { namespace detail
type detail (line 20) | namespace detail {
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
function has_expectation_failure (line 80) | bool has_expectation_failure(Context const& context) {
function set_expectation_failure (line 86) | void set_expectation_failure(
function get_expectation_failure (line 99) | decltype(auto) get_expectation_failure(
function reset_expectation_failure (line 108) | void reset_expectation_failure(Context const& context) {
type expect_directive (line 114) | struct expect_directive : unary_parser<Subject, expect_directive<S...
method expect_directive (line 119) | constexpr expect_directive(Subject const& subject)
method parse (line 124) | bool parse(Iterator& first, Iterator const& last
type expect_gen (line 140) | struct expect_gen
type detail (line 153) | namespace detail
function has_expectation_failure_impl (line 21) | inline bool has_expectation_failure_impl(bool& failure) {
function has_expectation_failure_impl (line 26) | bool has_expectation_failure_impl(
function set_expectation_failure_impl (line 33) | void set_expectation_failure_impl(
function set_expectation_failure_impl (line 42) | void set_expectation_failure_impl(
function get_expectation_failure_impl (line 54) | expectation_failure<Iterator> get_expectation_failure_impl(
function reset_expectation_failure_impl (line 69) | void reset_expectation_failure_impl(bool& failure) {
function reset_expectation_failure_impl (line 74) | void reset_expectation_failure_impl(std::optional<expectation_fa...
type parse_into_container_impl<expect_directive<Subject>, Context, RContext> (line 157) | struct parse_into_container_impl<expect_directive<Subject>, Cont...
method call (line 160) | static bool call(
FILE: tc/string/spirit/x3/directive/lexeme.hpp
type boost (line 17) | namespace boost { namespace spirit { namespace x3
type spirit (line 17) | namespace spirit { namespace x3
type x3 (line 17) | namespace x3
type lexeme_directive (line 20) | struct lexeme_directive : unary_parser<Subject, lexeme_directive<S...
method lexeme_directive (line 26) | constexpr lexeme_directive(Subject const& subject)
method parse (line 31) | typename enable_if<has_skipper<Context>, bool>::type
method parse (line 52) | typename disable_if<has_skipper<Context>, bool>::type
type lexeme_gen (line 65) | struct lexeme_gen
FILE: tc/string/spirit/x3/directive/matches.hpp
type boost (line 16) | namespace boost { namespace spirit { namespace x3
type spirit (line 16) | namespace spirit { namespace x3
type x3 (line 16) | namespace x3
type matches_directive (line 19) | struct matches_directive : unary_parser<Subject, matches_directive...
method matches_directive (line 25) | constexpr matches_directive(Subject const& subject) : base_type(...
method parse (line 29) | bool parse(Iterator& first, Iterator const& last
type matches_gen (line 42) | struct matches_gen
FILE: tc/string/spirit/x3/directive/no_case.hpp
type boost (line 15) | namespace boost { namespace spirit { namespace x3
type spirit (line 15) | namespace spirit { namespace x3
type x3 (line 15) | namespace x3
type no_case_directive (line 19) | struct no_case_directive : unary_parser<Subject, no_case_directive...
method no_case_directive (line 25) | constexpr no_case_directive(Subject const& subject)
method parse (line 30) | bool parse(Iterator& first, Iterator const& last
type no_case_gen (line 41) | struct no_case_gen
FILE: tc/string/spirit/x3/directive/no_skip.hpp
type boost (line 19) | namespace boost { namespace spirit { namespace x3
type spirit (line 19) | namespace spirit { namespace x3
type x3 (line 19) | namespace x3
type no_skip_directive (line 23) | struct no_skip_directive : unary_parser<Subject, no_skip_directive...
method no_skip_directive (line 29) | constexpr no_skip_directive(Subject const& subject)
method parse (line 34) | typename enable_if<has_skipper<Context>, bool>::type
method parse (line 53) | typename disable_if<has_skipper<Context>, bool>::type
type no_skip_gen (line 65) | struct no_skip_gen
FILE: tc/string/spirit/x3/directive/omit.hpp
type boost (line 13) | namespace boost { namespace spirit { namespace x3
type spirit (line 13) | namespace spirit { namespace x3
type x3 (line 13) | namespace x3
type omit_directive (line 20) | struct omit_directive : unary_parser<Subject, omit_directive<Subje...
method omit_directive (line 27) | constexpr omit_directive(Subject const& subject)
method parse (line 31) | bool parse(Iterator& first, Iterator const& last
type omit_gen (line 38) | struct omit_gen
FILE: tc/string/spirit/x3/directive/raw.hpp
type boost (line 16) | namespace boost { namespace spirit { namespace x3
type spirit (line 16) | namespace spirit { namespace x3
type x3 (line 16) | namespace x3
type raw_attribute_type (line 21) | struct raw_attribute_type {}
type raw_directive (line 24) | struct raw_directive : unary_parser<Subject, raw_directive<Subject>>
method raw_directive (line 31) | constexpr raw_directive(Subject const& subject)
method parse (line 36) | bool parse(Iterator& first, Iterator const& last
method parse (line 51) | bool parse(Iterator& first, Iterator const& last
type raw_gen (line 58) | struct raw_gen
type traits (line 70) | namespace traits
type pseudo_attribute<Context, raw_attribute_type, Iterator> (line 73) | struct pseudo_attribute<Context, raw_attribute_type, Iterator>
method type (line 78) | static type call(Iterator& first, Iterator const& last, attrib...
FILE: tc/string/spirit/x3/directive/repeat.hpp
type boost (line 16) | namespace boost { namespace spirit { namespace x3 { namespace detail
type spirit (line 16) | namespace spirit { namespace x3 { namespace detail
type x3 (line 16) | namespace x3 { namespace detail
type detail (line 16) | namespace detail
type exact_count (line 19) | struct exact_count // handles repeat(exact)[p]
method got_max (line 22) | bool got_max(T i) const { return i >= exact_value; }
method got_min (line 23) | bool got_min(T i) const { return i >= exact_value; }
type finite_count (line 29) | struct finite_count // handles repeat(min, max)[p]
method got_max (line 32) | bool got_max(T i) const { return i >= max_value; }
method got_min (line 33) | bool got_min(T i) const { return i >= min_value; }
type infinite_count (line 40) | struct infinite_count // handles repeat(min, inf)[p]
method got_max (line 43) | bool got_max(T /*i*/) const { return false; }
method got_min (line 44) | bool got_min(T i) const { return i >= min_value; }
type repeat_directive (line 53) | struct repeat_directive : unary_parser<Subject, repeat_directive<S...
method repeat_directive (line 59) | constexpr repeat_directive(Subject const& subject, RepeatCountLi...
method parse (line 66) | bool parse(
type inf_type (line 94) | struct inf_type {}
type repeat_gen (line 97) | struct repeat_gen
type repeat_gen_lvl1 (line 106) | struct repeat_gen_lvl1
method repeat_gen_lvl1 (line 108) | constexpr repeat_gen_lvl1(T&& repeat_limit_)
type traits (line 147) | namespace traits
type attribute_of<x3::repeat_directive<Subject,RepeatCountLimit>, Context> (line 150) | struct attribute_of<x3::repeat_directive<Subject,RepeatCountLimi...
type x3 (line 50) | namespace x3
type detail (line 16) | namespace detail
type exact_count (line 19) | struct exact_count // handles repeat(exact)[p]
method got_max (line 22) | bool got_max(T i) const { return i >= exact_value; }
method got_min (line 23) | bool got_min(T i) const { return i >= exact_value; }
type finite_count (line 29) | struct finite_count // handles repeat(min, max)[p]
method got_max (line 32) | bool got_max(T i) const { return i >= max_value; }
method got_min (line 33) | bool got_min(T i) const { return i >= min_value; }
type infinite_count (line 40) | struct infinite_count // handles repeat(min, inf)[p]
method got_max (line 43) | bool got_max(T /*i*/) const { return false; }
method got_min (line 44) | bool got_min(T i) const { return i >= min_value; }
type repeat_directive (line 53) | struct repeat_directive : unary_parser<Subject, repeat_directive<S...
method repeat_directive (line 59) | constexpr repeat_directive(Subject const& subject, RepeatCountLi...
method parse (line 66) | bool parse(
Condensed preview — 393 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,098K chars).
[
{
"path": ".gitattributes",
"chars": 12,
"preview": "* text=auto\n"
},
{
"path": ".github/workflows/main.yml",
"chars": 858,
"preview": "name: CI\n\non: [push, pull_request]\n\njobs:\n build:\n strategy:\n fail-fast: false\n matrix:\n image: [\"g"
},
{
"path": "CMakeLists.txt",
"chars": 1725,
"preview": "cmake_minimum_required(VERSION 3.21)\n\nproject(\n tc_library_test\n VERSION 1.0\n LANGUAGES C CXX\n)\n\nset(CMAKE_CXX_STANDA"
},
{
"path": "LICENSE_1_0.txt",
"chars": 1338,
"preview": "Boost Software License - Version 1.0 - August 17th, 2003\n\nPermission is hereby granted, free of charge, to any person or"
},
{
"path": "README.md",
"chars": 2568,
"preview": "[](https://github.com/think-cell/range/ac"
},
{
"path": "range.example.cpp",
"chars": 3767,
"preview": "\n// think-cell public library\n//\n// Copyright (C) 2016-2018 think-cell Software GmbH\n//\n// Distributed under the Boost S"
},
{
"path": "tc/algorithm/accumulate.h",
"chars": 2378,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/algorithm.h",
"chars": 48709,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/algorithm.t.cpp",
"chars": 9778,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/any_accu.h",
"chars": 685,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/append.h",
"chars": 11610,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/append.t.cpp",
"chars": 1657,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/best_element.h",
"chars": 3460,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/binary_operators.h",
"chars": 11798,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/break_or_continue.h",
"chars": 10625,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/compare.h",
"chars": 18528,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/element.h",
"chars": 12750,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/element.t.cpp",
"chars": 565,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/empty.h",
"chars": 1327,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n\n// Distributed under the Boost Software Lice"
},
{
"path": "tc/algorithm/empty.t.cpp",
"chars": 1422,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/equal.h",
"chars": 8599,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/equal.t.cpp",
"chars": 4885,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/filter_inplace.h",
"chars": 5575,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/find.h",
"chars": 7530,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/find_closest_if.h",
"chars": 2877,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/find_closest_if.t.cpp",
"chars": 1368,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/for_each.h",
"chars": 16017,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/for_each.t.cpp",
"chars": 12915,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/for_each_xxx.h",
"chars": 1626,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/interleave_ranges.h",
"chars": 5623,
"preview": "// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Lic"
},
{
"path": "tc/algorithm/longest_common_prefix.h",
"chars": 1644,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/longest_common_prefix.t.cpp",
"chars": 1086,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/minmax.h",
"chars": 2516,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/partition_iterator.h",
"chars": 8489,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/partition_range.h",
"chars": 3659,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/quantifier.h",
"chars": 6714,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/quantifier.t.cpp",
"chars": 1647,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/restrict_size_decrement.h",
"chars": 1757,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/round.h",
"chars": 19496,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/round.t.cpp",
"chars": 4545,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/size.h",
"chars": 9559,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/size_bounded.h",
"chars": 1905,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/size_linear.h",
"chars": 1382,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/sort_streaming.h",
"chars": 3080,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/algorithm/sort_streaming.t.cpp",
"chars": 691,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/array.h",
"chars": 14548,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/accessors.h",
"chars": 6652,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/as_lvalue.h",
"chars": 443,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/assert_defs.h",
"chars": 4569,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/bit_cast.h",
"chars": 10601,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/bitfield.h",
"chars": 1316,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/bitfield.t.cpp",
"chars": 2317,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/casts.h",
"chars": 12628,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/casts.t.cpp",
"chars": 1046,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/chained.h",
"chars": 2590,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/change.h",
"chars": 11517,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/conditional.h",
"chars": 973,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/conditional.t.cpp",
"chars": 2240,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/construction_restrictiveness.h",
"chars": 3375,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/derivable.h",
"chars": 2705,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/empty_chain.h",
"chars": 1151,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/enum.h",
"chars": 14100,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/enum.t.cpp",
"chars": 2563,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/explicit_cast.h",
"chars": 8018,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/explicit_cast_fwd.h",
"chars": 6703,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/functors.h",
"chars": 10669,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/fundamental.h",
"chars": 5450,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/generic_macros.h",
"chars": 7863,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/has_xxx.h",
"chars": 649,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/inplace.h",
"chars": 1828,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/inside_unwinding.h",
"chars": 713,
"preview": "#pragma once\n\n#include \"assert_defs.h\"\n#include <exception>\n\nnamespace tc {\n\tnamespace no_adl {\n\t\tstruct inside_unwindin"
},
{
"path": "tc/base/integer.h",
"chars": 5068,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/invoke.h",
"chars": 6845,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/invoke.t.cpp",
"chars": 3101,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/invoke_with_constant.h",
"chars": 3984,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/large_integer.h",
"chars": 1816,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/modified.h",
"chars": 922,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/modified.t.cpp",
"chars": 1851,
"preview": "\n// think-cell public library\n//\n// Copyright (C) 2016-2023 think-cell Software GmbH\n//\n// Distributed under the Boost S"
},
{
"path": "tc/base/move.h",
"chars": 4327,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/noncopyable.h",
"chars": 888,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/ref.h",
"chars": 6497,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/reference_or_value.h",
"chars": 8384,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/reference_or_value.t.cpp",
"chars": 1590,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/renew.h",
"chars": 5978,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/return_decltype.h",
"chars": 6601,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/rvalue_property.h",
"chars": 1854,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/rvalue_property.t.cpp",
"chars": 2211,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/safe_comparison.h",
"chars": 1357,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/safe_comparison.t.cpp",
"chars": 924,
"preview": "// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Lic"
},
{
"path": "tc/base/scope.h",
"chars": 5438,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/static_polymorphism.h",
"chars": 5770,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/string_template_param.h",
"chars": 1706,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/tag_type.h",
"chars": 2276,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/template_func.h",
"chars": 4033,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/temporary.h",
"chars": 12840,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/temporary.t.cpp",
"chars": 3670,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/track_instance.h",
"chars": 2944,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/track_instance.t.cpp",
"chars": 855,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/trivial_functors.h",
"chars": 1838,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/trivial_functors.t.cpp",
"chars": 2331,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/type_list.h",
"chars": 5924,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/type_list.t.cpp",
"chars": 2346,
"preview": "// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Lic"
},
{
"path": "tc/base/type_traits.h",
"chars": 5105,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/type_traits.t.cpp",
"chars": 30572,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/type_traits_fwd.h",
"chars": 35939,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/utility.h",
"chars": 15117,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/base/utility.t.cpp",
"chars": 4683,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/compat.t.cpp",
"chars": 5445,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/const.t.cpp",
"chars": 4110,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/container/cont_assign.h",
"chars": 4064,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/container/cont_assign.t.cpp",
"chars": 1579,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/container/cont_reserve.h",
"chars": 5915,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/container/container.h",
"chars": 5549,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/container/container_traits.h",
"chars": 2255,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/container/insert.h",
"chars": 8196,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/container/string.h",
"chars": 2662,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/create.t.cpp",
"chars": 1372,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/dense_map.h",
"chars": 27126,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/dense_map.natvis",
"chars": 2503,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?> \n<AutoVisualizer xmlns=\"http://schemas.microsoft.com/vstudio/debugger/natvis/2010"
},
{
"path": "tc/dense_map.t.cpp",
"chars": 7226,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/enumset.h",
"chars": 10741,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/interval.h",
"chars": 57238,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/interval.t.cpp",
"chars": 8584,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/interval_types.h",
"chars": 3271,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/optional.h",
"chars": 17318,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/optional.t.cpp",
"chars": 5841,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/adjacent_adaptor.h",
"chars": 10290,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/cartesian_product_adaptor.h",
"chars": 16481,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/concat_adaptor.h",
"chars": 18677,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/concat_adaptor.t.cpp",
"chars": 9230,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/conditional_range.h",
"chars": 14017,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/conditional_range.t.cpp",
"chars": 2645,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/empty_range.h",
"chars": 882,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/filter_adaptor.h",
"chars": 5856,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/index_iterator.h",
"chars": 14216,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/index_range.h",
"chars": 11120,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/intersection_adaptor.h",
"chars": 4871,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/intersection_adaptor.t.cpp",
"chars": 1631,
"preview": "// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Lic"
},
{
"path": "tc/range/iota_range.h",
"chars": 9468,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/iterator_cache.h",
"chars": 1226,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/iterator_facade.h",
"chars": 6419,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/join_adaptor.h",
"chars": 8374,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/join_framed_adaptor.h",
"chars": 5293,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/literal_range.h",
"chars": 3143,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/literal_range.t.cpp",
"chars": 1297,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/make_range.h",
"chars": 834,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/merge_range.h",
"chars": 729,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/merge_ranges.h",
"chars": 1042,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/merge_ranges.t.cpp",
"chars": 3767,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/meta.h",
"chars": 18174,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/ordered_pairs.h",
"chars": 2589,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/partial_sum.h",
"chars": 3003,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/range.t.cpp",
"chars": 17053,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/range_adaptor.h",
"chars": 20195,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/range_return.h",
"chars": 26727,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/repeat_n.h",
"chars": 1513,
"preview": "// \n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software"
},
{
"path": "tc/range/reverse_adaptor.h",
"chars": 7816,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/reverse_adaptor.t.cpp",
"chars": 2947,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/sparse_adaptor.h",
"chars": 4973,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/sparse_adaptor.t.cpp",
"chars": 704,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/subrange.h",
"chars": 35989,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/subrange.t.cpp",
"chars": 22824,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/take_while.h",
"chars": 3366,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/take_while.t.cpp",
"chars": 1752,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/transform.h",
"chars": 3301,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/transform.t.cpp",
"chars": 2230,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/transform_adaptor.h",
"chars": 5507,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/union_adaptor.h",
"chars": 12412,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/unique_range_adaptor.h",
"chars": 15854,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/zip_range.h",
"chars": 19148,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/range/zip_range.t.cpp",
"chars": 6496,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/restricted_enum.h",
"chars": 8419,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/restricted_enum.t.cpp",
"chars": 4517,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/static_vector.h",
"chars": 11755,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/storage_for.h",
"chars": 12460,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/ascii.h",
"chars": 4415,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/char.h",
"chars": 5525,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/char.t.cpp",
"chars": 5601,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/convert_enc.h",
"chars": 21106,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/convert_enc.t.cpp",
"chars": 1717,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/format.h",
"chars": 8422,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/jsonparser.h",
"chars": 35114,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/jsonparser.t.cpp",
"chars": 29923,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/make_c_str.h",
"chars": 4227,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/make_c_str.t.cpp",
"chars": 3226,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/named.h",
"chars": 1096,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/parserbase.h",
"chars": 8077,
"preview": "\n// think-cell public library\n//\n// Copyright (C) think-cell Software GmbH\n//\n// Distributed under the Boost Software Li"
},
{
"path": "tc/string/spirit/support/assert_msg.hpp",
"chars": 2225,
"preview": "// Copyright (c) 2001-2013 Hartmut Kaiser\n//\n// Distributed under the Boost Software License, Version 1.0. (See accomp"
},
{
"path": "tc/string/spirit/support/char_encoding/ascii.hpp",
"chars": 11483,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Hartmut Kaiser\n"
},
{
"path": "tc/string/spirit/support/char_encoding/iso8859_1.hpp",
"chars": 24692,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Hartmut Kaiser\n"
},
{
"path": "tc/string/spirit/support/char_encoding/standard.hpp",
"chars": 3551,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Hartmut Kaiser\n"
},
{
"path": "tc/string/spirit/support/char_encoding/standard_wide.hpp",
"chars": 4246,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Hartmut Kaiser\n"
},
{
"path": "tc/string/spirit/support/char_encoding/unicode/category_table.hpp",
"chars": 274887,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Joel de Guzman\n"
},
{
"path": "tc/string/spirit/support/char_encoding/unicode/lowercase_table.hpp",
"chars": 72609,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Joel de Guzman\n"
},
{
"path": "tc/string/spirit/support/char_encoding/unicode/query.hpp",
"chars": 8542,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Joel de Guzman\n"
},
{
"path": "tc/string/spirit/support/char_encoding/unicode/script_table.hpp",
"chars": 234171,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Joel de Guzman\n"
},
{
"path": "tc/string/spirit/support/char_encoding/unicode/uppercase_table.hpp",
"chars": 78603,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Joel de Guzman\n"
},
{
"path": "tc/string/spirit/support/char_encoding/unicode.hpp",
"chars": 12776,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Hartmut Kaiser\n"
},
{
"path": "tc/string/spirit/support/char_set/basic_chset.hpp",
"chars": 4482,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Joel de Guzman\n"
},
{
"path": "tc/string/spirit/support/char_set/range.hpp",
"chars": 953,
"preview": "/*=============================================================================\n\tCopyright (c) 2001-2011 Joel de Guzman\n"
}
]
// ... and 193 more files (download for full content)
About this extraction
This page contains the full source code of the think-cell/think-cell-library GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 393 files (2.7 MB), approximately 736.3k tokens, and a symbol index with 3165 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.