diff --git a/examples/inspect.cpp b/examples/inspect.cpp index fafbe4060..8cec64486 100644 --- a/examples/inspect.cpp +++ b/examples/inspect.cpp @@ -23,6 +23,7 @@ namespace ex = beman::execution; // ---------------------------------------------------------------------------- +#ifdef __cpp_rtti namespace meta { // The code in this namespace is a fairly basic way to print types. It can // almost certainly be done better, in particular using reflection. However, @@ -186,10 +187,12 @@ struct logger_t { inline constexpr logger_t logger{}; } // namespace +#endif // ---------------------------------------------------------------------------- int main() { +#ifdef __cpp_rtti auto log = [](std::string_view name) { return [name](std::string_view msg) { std::cout << name << " message='" << msg << "'\n"; }; }; @@ -201,4 +204,5 @@ int main() { ex::sync_wait(logger(ex::just(0, 1, 2), log("just(0, 1, 2)"))); ex::sync_wait(logger(ex::just_error(0), log("just_error(0)")) | ex::upon_error([](auto) {})); ex::sync_wait(logger(ex::just_stopped(), log("just_stopped()")) | ex::upon_stopped([]() {})); +#endif } diff --git a/examples/meta.hpp b/examples/meta.hpp deleted file mode 100644 index 3f6a04ca1..000000000 --- a/examples/meta.hpp +++ /dev/null @@ -1,124 +0,0 @@ -// examples/meta.hpp -*-C++-*- -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#ifndef INCLUDED_EXAMPLES_META -#define INCLUDED_EXAMPLES_META - -// ---------------------------------------------------------------------------- - -namespace meta { -// The code in this namespace is a fairly basic way to print types. It can -// almost certainly be done better, in particular using reflection. However, -// that's beside the point of this example. The important part for the -// example is that meta::type::name() yields a string representing the -// type T in some reasonable way -template