diff --git a/README.md b/README.md index d27c8a4..62b665a 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ using namespace dyno::literals; // Define the interface of something that can be drawn struct Drawable : decltype(dyno::requires( - "draw"_s = dyno::method + "draw"_dyno = dyno::method )) { }; // Define how concrete types can fulfill that interface template auto const dyno::default_concept_map = dyno::make_concept_map( - "draw"_s = [](T const& self, std::ostream& out) { self.draw(out); } + "draw"_dyno = [](T const& self, std::ostream& out) { self.draw(out); } ); // Define an object that can hold anything that can be drawn. @@ -42,7 +42,7 @@ struct drawable { drawable(T x) : poly_{x} { } void draw(std::ostream& out) const - { poly_.virtual_("draw"_s)(out); } + { poly_.virtual_("draw"_dyno)(out); } private: dyno::poly poly_; @@ -237,7 +237,7 @@ let's define an interface `Drawable` that describes types that can be drawn: using namespace dyno::literals; struct Drawable : decltype(dyno::requires( - "draw"_s = dyno::method + "draw"_dyno = dyno::method )) { }; ``` @@ -273,7 +273,7 @@ struct Square { /* ... */ }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "draw"_s = [](Square const& square, std::ostream& out) { + "draw"_dyno = [](Square const& square, std::ostream& out) { out << "square" << std::endl; } ); @@ -319,7 +319,7 @@ struct drawable { drawable(T x) : poly_{x} { } void draw(std::ostream& out) const - { poly_.virtual_("draw"_s)(out); } + { poly_.virtual_("draw"_dyno)(out); } private: dyno::poly poly_; @@ -356,7 +356,7 @@ of the `draw` method: ```c++ void draw(std::ostream& out) const -{ poly_.virtual_("draw"_s)(out); } +{ poly_.virtual_("draw"_dyno)(out); } ``` What happens here is that when `.draw` is called on our `drawable` object, @@ -414,7 +414,7 @@ struct drawable { drawable(T x) : poly_{x} { } void draw(std::ostream& out) const - { poly_.virtual_("draw"_s)(out); } + { poly_.virtual_("draw"_dyno)(out); } private: dyno::poly> poly_; @@ -465,7 +465,7 @@ struct drawable { drawable(T x) : poly_{x} { } void draw(std::ostream& out) const - { poly_.virtual_("draw"_s)(out); } + { poly_.virtual_("draw"_dyno)(out); } private: using Storage = dyno::sbo_storage<16>; // storage policy @@ -490,12 +490,12 @@ struct drawable { drawable(T x) : poly_{x} { } void draw(std::ostream& out) const - { poly_.virtual_("draw"_s)(out); } + { poly_.virtual_("draw"_dyno)(out); } private: using Storage = dyno::sbo_storage<16>; using VTable = dyno::vtable< - dyno::local>, + dyno::local>, dyno::remote >; dyno::poly poly_; @@ -523,7 +523,7 @@ For this, one can use `dyno::default_concept_map`: ```c++ template auto const dyno::default_concept_map = dyno::make_concept_map( - "draw"_s = [](auto const& self, std::ostream& out) { self.draw(out); } + "draw"_dyno = [](auto const& self, std::ostream& out) { self.draw(out); } ); ``` @@ -549,7 +549,7 @@ default one: ```c++ template <> auto dyno::concept_map = dyno::make_concept_map( - "draw"_s = [](Circle const& circle, std::ostream& out) { + "draw"_dyno = [](Circle const& circle, std::ostream& out) { out << "triangle" << std::endl; } ); @@ -569,7 +569,7 @@ template auto const dyno::concept_map, std::void_t() )>> = dyno::make_concept_map( - "draw"_s = [](std::vector const& v, std::ostream& out) { + "draw"_dyno = [](std::vector const& v, std::ostream& out) { for (auto const& x : v) out << x << ' '; } @@ -591,7 +591,7 @@ the concept using `dyno::function` instead of `dyno::method`, and use the ```c++ // Define the interface of something that can be drawn struct Drawable : decltype(dyno::requires( - "draw"_s = dyno::function + "draw"_dyno = dyno::function )) { }; ``` @@ -601,7 +601,7 @@ first parameter: ```c++ struct Drawable : decltype(dyno::requires( - "draw"_s = dyno::function + "draw"_dyno = dyno::function )) { }; ``` @@ -613,7 +613,7 @@ implementation match that of the function declared in the concept: // Define how concrete types can fulfill that interface template auto const dyno::default_concept_map = dyno::make_concept_map( - "draw"_s = [](std::ostream& out, T const& self) { self.draw(out); } + "draw"_dyno = [](std::ostream& out, T const& self) { self.draw(out); } // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ matches the concept definition ); ``` @@ -630,7 +630,7 @@ struct drawable { drawable(T x) : poly_{x} { } void draw(std::ostream& out) const - { poly_.virtual_("draw"_s)(out, poly_); } + { poly_.virtual_("draw"_dyno)(out, poly_); } // ^^^^^ passing the poly explicitly private: diff --git a/benchmark/any_iterator/dyno_generic.hpp b/benchmark/any_iterator/dyno_generic.hpp index 23bb0c5..6fb7b8a 100644 --- a/benchmark/any_iterator/dyno_generic.hpp +++ b/benchmark/any_iterator/dyno_generic.hpp @@ -14,9 +14,9 @@ namespace dyno_generic { template struct Iterator : decltype(dyno::requires( dyno::MoveConstructible{}, - "increment"_s = dyno::function, - "dereference"_s = dyno::function, - "equal"_s = dyno::function + "increment"_dyno = dyno::function, + "dereference"_dyno = dyno::function, + "equal"_dyno = dyno::function )) { }; template @@ -27,9 +27,9 @@ namespace dyno_generic { template explicit any_iterator(It it) : poly_{std::move(it), dyno::make_concept_map( - "increment"_s = [](It& self) { ++self; }, - "dereference"_s = [](It& self) -> decltype(auto) { return *self; }, - "equal"_s = [](It const& a, It const& b) -> bool { return a == b; } + "increment"_dyno = [](It& self) { ++self; }, + "dereference"_dyno = [](It& self) -> decltype(auto) { return *self; }, + "equal"_dyno = [](It const& a, It const& b) -> bool { return a == b; } )} { } @@ -38,16 +38,16 @@ namespace dyno_generic { { } any_iterator& operator++() { - poly_.virtual_("increment"_s)(poly_); + poly_.virtual_("increment"_dyno)(poly_); return *this; } reference operator*() { - return poly_.virtual_("dereference"_s)(poly_); + return poly_.virtual_("dereference"_dyno)(poly_); } friend bool operator==(any_iterator const& a, any_iterator const& b) { - return a.poly_.virtual_("equal"_s)(a.poly_, b.poly_); + return a.poly_.virtual_("equal"_dyno)(a.poly_, b.poly_); } private: @@ -66,9 +66,9 @@ namespace dyno_generic { int, dyno::local_storage<16>, dyno::vtable< - dyno::local>, + dyno::local>, dyno::remote > >; diff --git a/benchmark/n_functions.cpp b/benchmark/n_functions.cpp index eeb46f1..9299bdf 100644 --- a/benchmark/n_functions.cpp +++ b/benchmark/n_functions.cpp @@ -180,11 +180,11 @@ namespace { namespace dyno_remote { using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f1"_s = dyno::function, - "f2"_s = dyno::function, - "f3"_s = dyno::function, - "f4"_s = dyno::function, - "f5"_s = dyno::function + "f1"_dyno = dyno::function, + "f2"_dyno = dyno::function, + "f3"_dyno = dyno::function, + "f4"_dyno = dyno::function, + "f5"_dyno = dyno::function )) { }; template @@ -193,21 +193,21 @@ namespace { namespace dyno_remote { explicit any_template(T t) : vtable_{ dyno::complete_concept_map(dyno::make_concept_map( - "f1"_s = [](T& self) { ++self; }, - "f2"_s = [](T& self) { --self; }, - "f3"_s = [](T& self) { ++self; }, - "f4"_s = [](T& self) { --self; }, - "f5"_s = [](T& self) { ++self; } + "f1"_dyno = [](T& self) { ++self; }, + "f2"_dyno = [](T& self) { --self; }, + "f3"_dyno = [](T& self) { ++self; }, + "f4"_dyno = [](T& self) { --self; }, + "f5"_dyno = [](T& self) { ++self; } )) } , self_{new T(t)} { } - any_template& f1() { vtable_["f1"_s](self_); return *this; } - any_template& f2() { vtable_["f2"_s](self_); return *this; } - any_template& f3() { vtable_["f3"_s](self_); return *this; } - any_template& f4() { vtable_["f4"_s](self_); return *this; } - any_template& f5() { vtable_["f5"_s](self_); return *this; } + any_template& f1() { vtable_["f1"_dyno](self_); return *this; } + any_template& f2() { vtable_["f2"_dyno](self_); return *this; } + any_template& f3() { vtable_["f3"_dyno](self_); return *this; } + any_template& f4() { vtable_["f4"_dyno](self_); return *this; } + any_template& f5() { vtable_["f5"_dyno](self_); return *this; } private: using VTable = typename dyno::vtable::template apply; diff --git a/benchmark/storage/model.hpp b/benchmark/storage/model.hpp index 83b38c4..2bebb61 100644 --- a/benchmark/storage/model.hpp +++ b/benchmark/storage/model.hpp @@ -16,16 +16,16 @@ struct Concept : decltype(dyno::requires( dyno::Swappable{}, dyno::Destructible{}, dyno::Storable{}, - "f1"_s = dyno::function, - "f2"_s = dyno::function, - "f3"_s = dyno::function + "f1"_dyno = dyno::function, + "f2"_dyno = dyno::function, + "f3"_dyno = dyno::function )) { }; template auto const dyno::default_concept_map = dyno::make_concept_map( - "f1"_s = [](T& self) { benchmark::DoNotOptimize(self); }, - "f2"_s = [](T& self) { benchmark::DoNotOptimize(self); }, - "f3"_s = [](T& self) { benchmark::DoNotOptimize(self); } + "f1"_dyno = [](T& self) { benchmark::DoNotOptimize(self); }, + "f2"_dyno = [](T& self) { benchmark::DoNotOptimize(self); }, + "f3"_dyno = [](T& self) { benchmark::DoNotOptimize(self); } ); template @@ -37,9 +37,9 @@ struct model { void swap(model& other) { poly_.swap(other.poly_); } - void f1() { poly_.virtual_("f1"_s)(poly_); } - void f2() { poly_.virtual_("f2"_s)(poly_); } - void f3() { poly_.virtual_("f3"_s)(poly_); } + void f1() { poly_.virtual_("f1"_dyno)(poly_); } + void f2() { poly_.virtual_("f2"_dyno)(poly_); } + void f3() { poly_.virtual_("f3"_dyno)(poly_); } private: dyno::poly poly_; diff --git a/benchmark/vtable/dispatch.2.cpp b/benchmark/vtable/dispatch.2.cpp index 6a7fb15..81446b5 100644 --- a/benchmark/vtable/dispatch.2.cpp +++ b/benchmark/vtable/dispatch.2.cpp @@ -36,6 +36,6 @@ using inline_only = dyno::vtable< static constexpr int N = 100; BENCHMARK_TEMPLATE(BM_dispatch2, inheritance_tag)->Arg(N); BENCHMARK_TEMPLATE(BM_dispatch2, inline_only<>)->Arg(N); -BENCHMARK_TEMPLATE(BM_dispatch2, inline_only)->Arg(N); -BENCHMARK_TEMPLATE(BM_dispatch2, inline_only)->Arg(N); +BENCHMARK_TEMPLATE(BM_dispatch2, inline_only)->Arg(N); +BENCHMARK_TEMPLATE(BM_dispatch2, inline_only)->Arg(N); BENCHMARK_MAIN(); diff --git a/benchmark/vtable/dispatch.3.cpp b/benchmark/vtable/dispatch.3.cpp index 8c5b7dd..bd5ba53 100644 --- a/benchmark/vtable/dispatch.3.cpp +++ b/benchmark/vtable/dispatch.3.cpp @@ -37,7 +37,7 @@ using inline_only = dyno::vtable< static constexpr int N = 100; BENCHMARK_TEMPLATE(BM_dispatch3, inheritance_tag)->Arg(N); BENCHMARK_TEMPLATE(BM_dispatch3, inline_only<>)->Arg(N); -BENCHMARK_TEMPLATE(BM_dispatch3, inline_only)->Arg(N); -BENCHMARK_TEMPLATE(BM_dispatch3, inline_only)->Arg(N); -BENCHMARK_TEMPLATE(BM_dispatch3, inline_only)->Arg(N); +BENCHMARK_TEMPLATE(BM_dispatch3, inline_only)->Arg(N); +BENCHMARK_TEMPLATE(BM_dispatch3, inline_only)->Arg(N); +BENCHMARK_TEMPLATE(BM_dispatch3, inline_only)->Arg(N); BENCHMARK_MAIN(); diff --git a/benchmark/vtable/dispatch.4.cpp b/benchmark/vtable/dispatch.4.cpp index d3cf7d3..f453f15 100644 --- a/benchmark/vtable/dispatch.4.cpp +++ b/benchmark/vtable/dispatch.4.cpp @@ -38,8 +38,8 @@ using inline_only = dyno::vtable< static constexpr int N = 100; BENCHMARK_TEMPLATE(BM_dispatch4, inheritance_tag)->Arg(N); BENCHMARK_TEMPLATE(BM_dispatch4, inline_only<>)->Arg(N); -BENCHMARK_TEMPLATE(BM_dispatch4, inline_only)->Arg(N); -BENCHMARK_TEMPLATE(BM_dispatch4, inline_only)->Arg(N); -BENCHMARK_TEMPLATE(BM_dispatch4, inline_only)->Arg(N); -BENCHMARK_TEMPLATE(BM_dispatch4, inline_only)->Arg(N); +BENCHMARK_TEMPLATE(BM_dispatch4, inline_only)->Arg(N); +BENCHMARK_TEMPLATE(BM_dispatch4, inline_only)->Arg(N); +BENCHMARK_TEMPLATE(BM_dispatch4, inline_only)->Arg(N); +BENCHMARK_TEMPLATE(BM_dispatch4, inline_only)->Arg(N); BENCHMARK_MAIN(); diff --git a/benchmark/vtable/model.hpp b/benchmark/vtable/model.hpp index b2cb3c0..a6c3155 100644 --- a/benchmark/vtable/model.hpp +++ b/benchmark/vtable/model.hpp @@ -17,18 +17,18 @@ struct Concept : decltype(dyno::requires( dyno::Swappable{}, dyno::Destructible{}, dyno::Storable{}, - "f1"_s = dyno::function, - "f2"_s = dyno::function, - "f3"_s = dyno::function, - "f4"_s = dyno::function + "f1"_dyno = dyno::function, + "f2"_dyno = dyno::function, + "f3"_dyno = dyno::function, + "f4"_dyno = dyno::function )) { }; template auto const dyno::default_concept_map = dyno::make_concept_map( - "f1"_s = [](T& self) { ++self; benchmark::DoNotOptimize(self); }, - "f2"_s = [](T& self) { ++self; benchmark::DoNotOptimize(self); }, - "f3"_s = [](T& self) { ++self; benchmark::DoNotOptimize(self); }, - "f4"_s = [](T& self) { ++self; benchmark::DoNotOptimize(self); } + "f1"_dyno = [](T& self) { ++self; benchmark::DoNotOptimize(self); }, + "f2"_dyno = [](T& self) { ++self; benchmark::DoNotOptimize(self); }, + "f3"_dyno = [](T& self) { ++self; benchmark::DoNotOptimize(self); }, + "f4"_dyno = [](T& self) { ++self; benchmark::DoNotOptimize(self); } ); template @@ -38,10 +38,10 @@ struct model { : poly_{std::move(t)} { } - void f1() { poly_.virtual_("f1"_s)(poly_); } - void f2() { poly_.virtual_("f2"_s)(poly_); } - void f3() { poly_.virtual_("f3"_s)(poly_); } - void f4() { poly_.virtual_("f4"_s)(poly_); } + void f1() { poly_.virtual_("f1"_dyno)(poly_); } + void f2() { poly_.virtual_("f2"_dyno)(poly_); } + void f3() { poly_.virtual_("f3"_dyno)(poly_); } + void f4() { poly_.virtual_("f4"_dyno)(poly_); } private: dyno::poly, VTablePolicy> poly_; diff --git a/example/any_iterator.hpp b/example/any_iterator.hpp index 3944d16..52f2808 100644 --- a/example/any_iterator.hpp +++ b/example/any_iterator.hpp @@ -24,8 +24,8 @@ struct Iterator : decltype(dyno::requires( dyno::CopyAssignable{}, dyno::Destructible{}, dyno::Swappable{}, - "increment"_s = dyno::function, - "dereference"_s = dyno::function + "increment"_dyno = dyno::function, + "dereference"_dyno = dyno::function )) { }; template @@ -43,14 +43,14 @@ struct ForwardIterator : decltype(dyno::requires( template struct BidirectionalIterator : decltype(dyno::requires( ForwardIterator{}, - "decrement"_s = dyno::function + "decrement"_dyno = dyno::function )) { }; template struct RandomAccessIterator : decltype(dyno::requires( BidirectionalIterator{}, - "advance"_s = dyno::function, - "distance"_s = dyno::function + "advance"_dyno = dyno::function, + "distance"_dyno = dyno::function )) { }; @@ -59,22 +59,22 @@ struct RandomAccessIterator : decltype(dyno::requires( // specific iterator type. template auto const dyno::default_concept_map, T> = dyno::make_concept_map( - "increment"_s = [](T& self) { ++self; }, - "dereference"_s = [](T& self) -> Ref { return *self; } + "increment"_dyno = [](T& self) { ++self; }, + "dereference"_dyno = [](T& self) -> Ref { return *self; } ); template auto const dyno::default_concept_map, T> = dyno::make_concept_map( - "decrement"_s = [](T& self) -> void { --self; } + "decrement"_dyno = [](T& self) -> void { --self; } ); template auto const dyno::default_concept_map, T> = dyno::make_concept_map( - "advance"_s = [](T& self, Diff diff) -> void { + "advance"_dyno = [](T& self, Diff diff) -> void { std::advance(self, diff); }, - "distance"_s = [](T const& first, T const& last) -> Diff { + "distance"_dyno = [](T const& first, T const& last) -> Diff { return std::distance(first, last); } ); @@ -176,24 +176,24 @@ struct any_iterator { friend void swap(any_iterator& a, any_iterator& b) { a.swap(b); } any_iterator& operator++() { - poly_.virtual_("increment"_s)(poly_); + poly_.virtual_("increment"_dyno)(poly_); return *this; } template {} >> any_iterator& operator--() { - poly_.virtual_("decrement"_s)(poly_); + poly_.virtual_("decrement"_dyno)(poly_); return *this; } reference operator*() { - return poly_.virtual_("dereference"_s)(poly_); + return poly_.virtual_("dereference"_dyno)(poly_); } friend bool operator==(any_iterator const& a, any_iterator const& b) { - assert(a.poly_.virtual_("typeid"_s)() == b.poly_.virtual_("typeid"_s)()); - return a.poly_.virtual_("equal"_s)(a.poly_, b.poly_); + assert(a.poly_.virtual_("typeid"_dyno)() == b.poly_.virtual_("typeid"_dyno)()); + return a.poly_.virtual_("equal"_dyno)(a.poly_, b.poly_); } friend bool operator!=(any_iterator const& a, any_iterator const& b) { diff --git a/example/any_range.cpp b/example/any_range.cpp index f9001d7..0916e95 100644 --- a/example/any_range.cpp +++ b/example/any_range.cpp @@ -22,24 +22,24 @@ using namespace dyno::literals; template struct Range : decltype(dyno::requires( - "begin"_s = dyno::function (dyno::T&)>, - "end"_s = dyno::function (dyno::T&)>, - "cbegin"_s = dyno::function (dyno::T const&)>, - "cend"_s = dyno::function (dyno::T const&)> + "begin"_dyno = dyno::function (dyno::T&)>, + "end"_dyno = dyno::function (dyno::T&)>, + "cbegin"_dyno = dyno::function (dyno::T const&)>, + "cend"_dyno = dyno::function (dyno::T const&)> )) { }; template auto const dyno::default_concept_map, R> = dyno::make_concept_map( - "begin"_s = [](R& range) -> any_iterator { + "begin"_dyno = [](R& range) -> any_iterator { return any_iterator{range.begin()}; }, - "end"_s = [](R& range) -> any_iterator { + "end"_dyno = [](R& range) -> any_iterator { return any_iterator{range.end()}; }, - "cbegin"_s = [](R const& range) -> any_iterator { + "cbegin"_dyno = [](R const& range) -> any_iterator { return any_iterator{range.cbegin()}; }, - "cend"_s = [](R const& range) -> any_iterator { + "cend"_dyno = [](R const& range) -> any_iterator { return any_iterator{range.cend()}; } ); @@ -49,13 +49,13 @@ struct any_range { template any_range(Range&& r) : poly_{std::forward(r)} { } - auto begin() { return poly_.virtual_("begin"_s)(poly_); } - auto end() { return poly_.virtual_("end"_s)(poly_); } + auto begin() { return poly_.virtual_("begin"_dyno)(poly_); } + auto end() { return poly_.virtual_("end"_dyno)(poly_); } auto begin() const { return cbegin(); } auto end() const { return cend(); } - auto cbegin() const { return poly_.virtual_("cbegin"_s)(poly_); } - auto cend() const { return poly_.virtual_("cend"_s)(poly_); } + auto cbegin() const { return poly_.virtual_("cbegin"_dyno)(poly_); } + auto cend() const { return poly_.virtual_("cend"_dyno)(poly_); } private: dyno::poly> poly_; diff --git a/example/drawable.dyno.cpp b/example/drawable.dyno.cpp index 594eb35..727b5bb 100644 --- a/example/drawable.dyno.cpp +++ b/example/drawable.dyno.cpp @@ -55,7 +55,7 @@ void draw(document_t const& self, std::ostream& out) { struct Drawable : decltype(dyno::requires( - "draw"_s = dyno::function + "draw"_dyno = dyno::function )) { }; class object_t { @@ -63,12 +63,12 @@ class object_t { template object_t(T x) : poly_{std::move(x), dyno::make_concept_map( - "draw"_s = [](T const& self, std::ostream& out) { draw(self, out); } + "draw"_dyno = [](T const& self, std::ostream& out) { draw(self, out); } )} { } friend void draw(object_t const& x, std::ostream& out) { - x.poly_.virtual_("draw"_s)(x.poly_, out); + x.poly_.virtual_("draw"_dyno)(x.poly_, out); } private: diff --git a/example/function.cpp b/example/function.cpp index 80430bb..ddc9110 100644 --- a/example/function.cpp +++ b/example/function.cpp @@ -25,12 +25,12 @@ struct Callable : decltype(dyno::requires( dyno::CopyConstructible{}, dyno::MoveConstructible{}, dyno::Destructible{}, - "call"_s = dyno::function + "call"_dyno = dyno::function )) { }; template auto const dyno::default_concept_map, F> = dyno::make_concept_map( - "call"_s = [](F const& f, Args ...args) -> R { + "call"_dyno = [](F const& f, Args ...args) -> R { return f(std::forward(args)...); } ); @@ -44,7 +44,7 @@ struct basic_function { basic_function(F&& f) : poly_{std::forward(f)} { } R operator()(Args ...args) const - { return poly_.virtual_("call"_s)(poly_, std::forward(args)...); } + { return poly_.virtual_("call"_dyno)(poly_, std::forward(args)...); } private: dyno::poly, StoragePolicy> poly_; diff --git a/example/overview.cpp b/example/overview.cpp index 0137674..f109763 100644 --- a/example/overview.cpp +++ b/example/overview.cpp @@ -14,13 +14,13 @@ using namespace dyno::literals; // Define the interface of something that can be drawn struct Drawable : decltype(dyno::requires( - "draw"_s = dyno::method + "draw"_dyno = dyno::method )) { }; // Define how concrete types can fulfill that interface template auto const dyno::default_concept_map = dyno::make_concept_map( - "draw"_s = [](T const& self, std::ostream& out) { self.draw(out); } + "draw"_dyno = [](T const& self, std::ostream& out) { self.draw(out); } ); // Define an object that can hold anything that can be drawn. @@ -29,7 +29,7 @@ struct drawable { drawable(T x) : poly_{x} { } void draw(std::ostream& out) const - { poly_.virtual_("draw"_s)(out); } + { poly_.virtual_("draw"_dyno)(out); } private: dyno::poly poly_; diff --git a/example/readme.cpp b/example/readme.cpp index 243c2cc..c371fc4 100644 --- a/example/readme.cpp +++ b/example/readme.cpp @@ -11,12 +11,12 @@ using namespace dyno::literals; struct Drawable : decltype(dyno::requires( - "draw"_s = dyno::method + "draw"_dyno = dyno::method )) { }; template auto const dyno::default_concept_map = dyno::make_concept_map( - "draw"_s = [](auto const& self, std::ostream& out) { self.draw(out); } + "draw"_dyno = [](auto const& self, std::ostream& out) { self.draw(out); } ); struct drawable { @@ -24,7 +24,7 @@ struct drawable { drawable(T x) : poly_{x} { } void draw(std::ostream& out) const - { poly_.virtual_("draw"_s)(out); } + { poly_.virtual_("draw"_dyno)(out); } private: dyno::poly poly_; @@ -35,7 +35,7 @@ struct Square { /* ... */ }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "draw"_s = [](Square const& /*square*/, std::ostream& out) { + "draw"_dyno = [](Square const& /*square*/, std::ostream& out) { out << "square" << std::endl; } ); @@ -52,7 +52,7 @@ template auto const dyno::concept_map, std::void_t() )>> = dyno::make_concept_map( - "draw"_s = [](std::vector const& v, std::ostream& out) { + "draw"_dyno = [](std::vector const& v, std::ostream& out) { for (auto const& x : v) out << x << ' '; } diff --git a/example/readme.non_member.cpp b/example/readme.non_member.cpp index 73d445f..6b5340d 100644 --- a/example/readme.non_member.cpp +++ b/example/readme.non_member.cpp @@ -15,13 +15,13 @@ using namespace dyno::literals; // Define the interface of something that can be drawn struct Drawable : decltype(dyno::requires( - "draw"_s = dyno::function + "draw"_dyno = dyno::function )) { }; // Define how concrete types can fulfill that interface template auto const dyno::default_concept_map = dyno::make_concept_map( - "draw"_s = [](std::ostream& out, T const& self) { self.draw(out); } + "draw"_dyno = [](std::ostream& out, T const& self) { self.draw(out); } // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ matches the concept definition ); @@ -31,7 +31,7 @@ struct drawable { drawable(T x) : poly_{x} { } void draw(std::ostream& out) const - { poly_.virtual_("draw"_s)(out, poly_); } + { poly_.virtual_("draw"_dyno)(out, poly_); } // ^^^^^ passing the poly explicitly private: diff --git a/example/vtable_traits.cpp b/example/vtable_traits.cpp index 1a7b026..314be3e 100644 --- a/example/vtable_traits.cpp +++ b/example/vtable_traits.cpp @@ -27,22 +27,22 @@ struct Iterator : decltype(dyno::requires( dyno::Destructible{}, dyno::Swappable{}, dyno::EqualityComparable{}, - "increment"_s = dyno::function, - "decrement"_s = dyno::function, - "dereference"_s = dyno::function, - "advance"_s = dyno::function, - "distance"_s = dyno::function + "increment"_dyno = dyno::function, + "decrement"_dyno = dyno::function, + "dereference"_dyno = dyno::function, + "advance"_dyno = dyno::function, + "distance"_dyno = dyno::function )) { }; template auto const dyno::default_concept_map, T> = dyno::make_concept_map( - "increment"_s = [](T& self) { ++self; }, - "decrement"_s = [](T& self) -> void { --self; }, - "dereference"_s = [](T& self) -> Ref { return *self; }, - "advance"_s = [](T& self, std::ptrdiff_t diff) -> void { + "increment"_dyno = [](T& self) { ++self; }, + "decrement"_dyno = [](T& self) -> void { --self; }, + "dereference"_dyno = [](T& self) -> Ref { return *self; }, + "advance"_dyno = [](T& self, std::ptrdiff_t diff) -> void { std::advance(self, diff); }, - "distance"_s = [](T const& first, T const& last) -> std::ptrdiff_t { + "distance"_dyno = [](T const& first, T const& last) -> std::ptrdiff_t { return std::distance(first, last); } ); @@ -60,7 +60,7 @@ struct any_iterator { using Storage = dyno::remote_storage; using VTable = dyno::vtable< dyno::local>, dyno::remote >; @@ -86,21 +86,21 @@ struct any_iterator { friend void swap(any_iterator& a, any_iterator& b) { a.swap(b); } any_iterator& operator++() { - poly_.virtual_("increment"_s)(poly_); + poly_.virtual_("increment"_dyno)(poly_); return *this; } any_iterator& operator--() { - poly_.virtual_("decrement"_s)(poly_); + poly_.virtual_("decrement"_dyno)(poly_); return *this; } reference operator*() { - return poly_.virtual_("dereference"_s)(poly_); + return poly_.virtual_("dereference"_dyno)(poly_); } friend bool operator==(any_iterator const& a, any_iterator const& b) { - return a.poly_.virtual_("equal"_s)(a.poly_, b.poly_); + return a.poly_.virtual_("equal"_dyno)(a.poly_, b.poly_); } friend bool operator!=(any_iterator const& a, any_iterator const& b) { diff --git a/include/dyno/builtin.hpp b/include/dyno/builtin.hpp index 1916647..e88f294 100644 --- a/include/dyno/builtin.hpp +++ b/include/dyno/builtin.hpp @@ -28,48 +28,48 @@ template constexpr auto storage_info_for = storage_info{sizeof(T), alignof(T)}; struct Storable : decltype(dyno::requires( - "storage_info"_s = dyno::function + "storage_info"_dyno = dyno::function )) { }; template auto const default_concept_map = dyno::make_concept_map( - "storage_info"_s = []() { return dyno::storage_info_for; } + "storage_info"_dyno = []() { return dyno::storage_info_for; } ); struct TypeId : decltype(dyno::requires( - "typeid"_s = dyno::function + "typeid"_dyno = dyno::function )) { }; template auto const default_concept_map = dyno::make_concept_map( - "typeid"_s = []() -> std::type_info const& { return typeid(T); } + "typeid"_dyno = []() -> std::type_info const& { return typeid(T); } ); struct DefaultConstructible : decltype(dyno::requires( - "default-construct"_s = dyno::function + "default-construct"_dyno = dyno::function )) { }; template auto const default_concept_map::value> > = dyno::make_concept_map( - "default-construct"_s = [](void* p) { + "default-construct"_dyno = [](void* p) { new (p) T(); } ); struct MoveConstructible : decltype(dyno::requires( - "move-construct"_s = dyno::function + "move-construct"_dyno = dyno::function )) { }; template auto const default_concept_map::value> > = dyno::make_concept_map( - "move-construct"_s = [](void* p, T&& other) { + "move-construct"_dyno = [](void* p, T&& other) { new (p) T(std::move(other)); } ); @@ -77,14 +77,14 @@ auto const default_concept_map + "copy-construct"_dyno = dyno::function )) { }; template auto const default_concept_map::value> > = dyno::make_concept_map( - "copy-construct"_s = [](void* p, T const& other) { + "copy-construct"_dyno = [](void* p, T const& other) { new (p) T(other); } ); @@ -107,26 +107,26 @@ struct Swappable : decltype(dyno::requires( struct EqualityComparable : decltype(dyno::requires( - "equal"_s = dyno::function + "equal"_dyno = dyno::function )) { }; template auto const default_concept_map() == std::declval())) > = dyno::make_concept_map( - "equal"_s = [](T const& a, T const& b) -> bool { return a == b; } + "equal"_dyno = [](T const& a, T const& b) -> bool { return a == b; } ); struct Destructible : decltype(dyno::requires( - "destruct"_s = dyno::function + "destruct"_dyno = dyno::function )) { }; template auto const default_concept_map::value> > = dyno::make_concept_map( - "destruct"_s = [](T& self) { self.~T(); } + "destruct"_dyno = [](T& self) { self.~T(); } ); } // end namespace dyno diff --git a/include/dyno/concept.hpp b/include/dyno/concept.hpp index 1401353..7ddfe24 100644 --- a/include/dyno/concept.hpp +++ b/include/dyno/concept.hpp @@ -144,7 +144,7 @@ struct concept : detail::concept_base { // template // struct Iterator : decltype(dyno::requires( // Incrementable{}, -// "dereference"_s = dyno::function +// "dereference"_dyno = dyno::function // ... // )) { }; // ``` diff --git a/include/dyno/concept_map.hpp b/include/dyno/concept_map.hpp index 3e1cbf2..ded1cc4 100644 --- a/include/dyno/concept_map.hpp +++ b/include/dyno/concept_map.hpp @@ -220,24 +220,24 @@ namespace diagnostic { // the mappings provided explicitly. For example: // ``` // struct A : decltype(dyno::requires( -// "f"_s = dyno::function +// "f"_dyno = dyno::function // )) { }; // // struct B : decltype(dyno::requires( // A{}, -// "g"_s = dyno::function +// "g"_dyno = dyno::function // )) { }; // // struct Foo { }; // // template <> // auto const dyno::concept_map = dyno::make_concept_map( -// "f"_s = [](Foo&) { } +// "f"_dyno = [](Foo&) { } // ); // // template <> // auto const dyno::concept_map = dyno::make_concept_map( -// "g"_s = [](Foo&) { return 0; } +// "g"_dyno = [](Foo&) { return 0; } // ); // // auto complete = dyno::complete_concept_map(dyno::concept_map); diff --git a/include/dyno/detail/dsl.hpp b/include/dyno/detail/dsl.hpp index 664fa92..4cfb025 100644 --- a/include/dyno/detail/dsl.hpp +++ b/include/dyno/detail/dsl.hpp @@ -121,7 +121,7 @@ inline namespace literals { // Creates a compile-time string that can be used as the left-hand-side when // defining clauses or filling concept maps. template - constexpr auto operator""_s() { return detail::string{}; } + constexpr auto operator""_dyno() { return detail::string{}; } } // end namespace literals // Creates a Dyno compile-time string without requiring the use of a diff --git a/include/dyno/storage.hpp b/include/dyno/storage.hpp index 26a8012..806d610 100644 --- a/include/dyno/storage.hpp +++ b/include/dyno/storage.hpp @@ -144,15 +144,15 @@ class sbo_storage { template sbo_storage(sbo_storage const& other, VTable const& vtable) { if (other.uses_heap()) { - auto info = vtable["storage_info"_s](); + auto info = vtable["storage_info"_dyno](); uses_heap_ = true; ptr_ = std::malloc(info.size); // TODO: That's not a really nice way to handle this assert(ptr_ != nullptr && "std::malloc failed, we're doomed"); - vtable["copy-construct"_s](ptr_, other.get()); + vtable["copy-construct"_dyno](ptr_, other.get()); } else { uses_heap_ = false; - vtable["copy-construct"_s](&sb_, other.get()); + vtable["copy-construct"_dyno](&sb_, other.get()); } } @@ -164,7 +164,7 @@ class sbo_storage { this->ptr_ = other.ptr_; other.ptr_ = nullptr; } else { - vtable["move-construct"_s](this->get(), other.get()); + vtable["move-construct"_dyno](this->get(), other.get()); } } @@ -181,8 +181,8 @@ class sbo_storage { void *ptr = this->ptr_; // Bring `other`'s contents to `*this`, destructively - other_vtable["move-construct"_s](&this->sb_, &other.sb_); - other_vtable["destruct"_s](&other.sb_); + other_vtable["move-construct"_dyno](&this->sb_, &other.sb_); + other_vtable["destruct"_dyno](&other.sb_); this->uses_heap_ = false; // Bring `*this`'s stuff to `other` @@ -194,8 +194,8 @@ class sbo_storage { void *ptr = other.ptr_; // Bring `*this`'s contents to `other`, destructively - this_vtable["move-construct"_s](&other.sb_, &this->sb_); - this_vtable["destruct"_s](&this->sb_); + this_vtable["move-construct"_dyno](&other.sb_, &this->sb_); + this_vtable["destruct"_dyno](&this->sb_); other.uses_heap_ = false; // Bring `other`'s stuff to `*this` @@ -205,16 +205,16 @@ class sbo_storage { } else { // Move `other` into temporary local storage, destructively. SBStorage tmp; - other_vtable["move-construct"_s](&tmp, &other.sb_); - other_vtable["destruct"_s](&other.sb_); + other_vtable["move-construct"_dyno](&tmp, &other.sb_); + other_vtable["destruct"_dyno](&other.sb_); // Move `*this` into `other`, destructively. - this_vtable["move-construct"_s](&other.sb_, &this->sb_); - this_vtable["destruct"_s](&this->sb_); + this_vtable["move-construct"_dyno](&other.sb_, &this->sb_); + this_vtable["destruct"_dyno](&this->sb_); // Now, bring `tmp` into `*this`, destructively. - other_vtable["move-construct"_s](&this->sb_, &tmp); - other_vtable["destruct"_s](&tmp); + other_vtable["move-construct"_dyno](&this->sb_, &tmp); + other_vtable["destruct"_dyno](&tmp); } } } @@ -226,10 +226,10 @@ class sbo_storage { if (ptr_ == nullptr) return; - vtable["destruct"_s](ptr_); + vtable["destruct"_dyno](ptr_); std::free(ptr_); } else { - vtable["destruct"_s](&sb_); + vtable["destruct"_dyno](&sb_); } } @@ -269,12 +269,12 @@ struct remote_storage { template remote_storage(remote_storage const& other, VTable const& vtable) - : ptr_{std::malloc(vtable["storage_info"_s]().size)} + : ptr_{std::malloc(vtable["storage_info"_dyno]().size)} { // TODO: That's not a really nice way to handle this assert(ptr_ != nullptr && "std::malloc failed, we're doomed"); - vtable["copy-construct"_s](this->get(), other.get()); + vtable["copy-construct"_dyno](this->get(), other.get()); } template @@ -295,7 +295,7 @@ struct remote_storage { if (ptr_ == nullptr) return; - vtable["destruct"_s](ptr_); + vtable["destruct"_dyno](ptr_); std::free(ptr_); } @@ -418,20 +418,20 @@ class local_storage { template local_storage(local_storage const& other, VTable const& vtable) { - assert(can_store(vtable["storage_info"_s]()) && + assert(can_store(vtable["storage_info"_dyno]()) && "dyno::local_storage: Trying to copy-construct using a vtable that " "describes an object that won't fit in the storage."); - vtable["copy-construct"_s](this->get(), other.get()); + vtable["copy-construct"_dyno](this->get(), other.get()); } template local_storage(local_storage&& other, VTable const& vtable) { - assert(can_store(vtable["storage_info"_s]()) && + assert(can_store(vtable["storage_info"_dyno]()) && "dyno::local_storage: Trying to move-construct using a vtable that " "describes an object that won't fit in the storage."); - vtable["move-construct"_s](this->get(), other.get()); + vtable["move-construct"_dyno](this->get(), other.get()); } template @@ -441,21 +441,21 @@ class local_storage { // Move `other` into temporary local storage, destructively. SBStorage tmp; - other_vtable["move-construct"_s](&tmp, &other.buffer_); - other_vtable["destruct"_s](&other.buffer_); + other_vtable["move-construct"_dyno](&tmp, &other.buffer_); + other_vtable["destruct"_dyno](&other.buffer_); // Move `*this` into `other`, destructively. - this_vtable["move-construct"_s](&other.buffer_, &this->buffer_); - this_vtable["destruct"_s](&this->buffer_); + this_vtable["move-construct"_dyno](&other.buffer_, &this->buffer_); + this_vtable["destruct"_dyno](&this->buffer_); // Now, bring `tmp` into `*this`, destructively. - other_vtable["move-construct"_s](&this->buffer_, &tmp); - other_vtable["destruct"_s](&tmp); + other_vtable["move-construct"_dyno](&this->buffer_, &tmp); + other_vtable["destruct"_dyno](&tmp); } template void destruct(VTable const& vtable) { - vtable["destruct"_s](&buffer_); + vtable["destruct"_dyno](&buffer_); } template diff --git a/include/dyno/vtable.hpp b/include/dyno/vtable.hpp index 2d6951f..9530ef2 100644 --- a/include/dyno/vtable.hpp +++ b/include/dyno/vtable.hpp @@ -390,11 +390,11 @@ constexpr auto generate_vtable(Policies policies) { // // dyno::only // Picks only the specified functions from a concept. `functions` must be -// compile-time strings, such as `dyno::only`. +// compile-time strings, such as `dyno::only`. // // dyno::except // Picks all but the specified functions from a concept. `functions` must -// be compile-time strings, such as `dyno::except`. +// be compile-time strings, such as `dyno::except`. // // dyno::everything // Picks all the functions from a concept. diff --git a/test/concept.clause_names.cpp b/test/concept.clause_names.cpp index 922b9a6..36d3417 100644 --- a/test/concept.clause_names.cpp +++ b/test/concept.clause_names.cpp @@ -13,13 +13,13 @@ namespace hana = boost::hana; struct A : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct B : decltype(dyno::requires( A{}, - "g"_s = dyno::function, - "h"_s = dyno::function + "g"_dyno = dyno::function, + "h"_dyno = dyno::function )) { }; struct C : decltype(dyno::requires( @@ -27,12 +27,12 @@ struct C : decltype(dyno::requires( )) { }; static_assert(hana::to_set(dyno::clause_names(A{})) == - hana::make_set("f"_s), ""); + hana::make_set("f"_dyno), ""); static_assert(hana::to_set(dyno::clause_names(B{})) == - hana::make_set("f"_s, "g"_s, "h"_s), ""); + hana::make_set("f"_dyno, "g"_dyno, "h"_dyno), ""); static_assert(hana::to_set(dyno::clause_names(C{})) == - hana::make_set("f"_s, "g"_s, "h"_s), ""); + hana::make_set("f"_dyno, "g"_dyno, "h"_dyno), ""); int main() { } diff --git a/test/concept.clauses.cpp b/test/concept.clauses.cpp index 2cff095..6c3517f 100644 --- a/test/concept.clauses.cpp +++ b/test/concept.clauses.cpp @@ -14,13 +14,13 @@ namespace hana = boost::hana; struct A : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct B : decltype(dyno::requires( A{}, - "g"_s = dyno::function, - "h"_s = dyno::function + "g"_dyno = dyno::function, + "h"_dyno = dyno::function )) { }; struct C : decltype(dyno::requires( @@ -29,21 +29,21 @@ struct C : decltype(dyno::requires( static_assert(hana::to_set(dyno::clauses(A{})) == hana::to_set(hana::make_tuple( - "f"_s = dyno::function + "f"_dyno = dyno::function )), ""); static_assert(hana::to_set(dyno::clauses(B{})) == hana::to_set(hana::make_tuple( - "f"_s = dyno::function, - "g"_s = dyno::function, - "h"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function, + "h"_dyno = dyno::function )), ""); static_assert(hana::to_set(dyno::clauses(C{})) == hana::to_set(hana::make_tuple( - "f"_s = dyno::function, - "g"_s = dyno::function, - "h"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function, + "h"_dyno = dyno::function )), ""); int main() { } diff --git a/test/concept.duplicate.cpp b/test/concept.duplicate.cpp index 603d1ef..e9cdd05 100644 --- a/test/concept.duplicate.cpp +++ b/test/concept.duplicate.cpp @@ -11,7 +11,7 @@ using namespace dyno::literals; // to two concepts that we derive from. struct CommonBase : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Base1 : decltype(dyno::requires( diff --git a/test/concept.duplicate.fail.direct.cpp b/test/concept.duplicate.fail.direct.cpp index 3a0e822..0639d4d 100644 --- a/test/concept.duplicate.fail.direct.cpp +++ b/test/concept.duplicate.fail.direct.cpp @@ -8,8 +8,8 @@ using namespace dyno::literals; // MESSAGE[dyno::concept: It looks like you have multiple clauses with the same name in your concept definition] struct Concept : decltype(dyno::requires( - "f"_s = dyno::function, - "f"_s = dyno::function + "f"_dyno = dyno::function, + "f"_dyno = dyno::function )) { }; int main() { } diff --git a/test/concept.duplicate.fail.redefine.1.cpp b/test/concept.duplicate.fail.redefine.1.cpp index 45127ed..321a89d 100644 --- a/test/concept.duplicate.fail.redefine.1.cpp +++ b/test/concept.duplicate.fail.redefine.1.cpp @@ -7,14 +7,14 @@ using namespace dyno::literals; struct Base : decltype(dyno::requires( - "f"_s = dyno::function, - "g"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function )) { }; // MESSAGE[dyno::concept: It looks like you are redefining a clause that is already defined in a base concept] struct Derived : decltype(dyno::requires( Base{}, - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; int main() { } diff --git a/test/concept.duplicate.fail.redefine.2.cpp b/test/concept.duplicate.fail.redefine.2.cpp index c238db8..caf35d9 100644 --- a/test/concept.duplicate.fail.redefine.2.cpp +++ b/test/concept.duplicate.fail.redefine.2.cpp @@ -7,8 +7,8 @@ using namespace dyno::literals; struct Base0 : decltype(dyno::requires( - "f"_s = dyno::function, - "g"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function )) { }; struct Base1 : decltype(dyno::requires( @@ -18,7 +18,7 @@ struct Base1 : decltype(dyno::requires( // MESSAGE[dyno::concept: It looks like you are redefining a clause that is already defined in a base concept] struct Derived : decltype(dyno::requires( Base1{}, - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; int main() { } diff --git a/test/concept.refined.cpp b/test/concept.refined.cpp index f2fae04..5fca23e 100644 --- a/test/concept.refined.cpp +++ b/test/concept.refined.cpp @@ -13,12 +13,12 @@ using namespace dyno::literals; struct A : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct B : decltype(dyno::requires( A{}, - "g"_s = dyno::function + "g"_dyno = dyno::function )) { }; struct C : decltype(dyno::requires( @@ -26,14 +26,14 @@ struct C : decltype(dyno::requires( )) { }; struct D : decltype(dyno::requires( - "h"_s = dyno::function + "h"_dyno = dyno::function )) { }; struct E : decltype(dyno::requires( C{}, - "i"_s = dyno::function, + "i"_dyno = dyno::function, D{}, - "j"_s = dyno::function + "j"_dyno = dyno::function )) { }; template diff --git a/test/concept_map.cpp b/test/concept_map.cpp index d6f8133..c0dd550 100644 --- a/test/concept_map.cpp +++ b/test/concept_map.cpp @@ -10,12 +10,12 @@ using namespace dyno::literals; struct A : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct B : decltype(dyno::requires( A{}, - "g"_s = dyno::function + "g"_dyno = dyno::function )) { }; struct C : decltype(dyno::requires(B{})) { }; @@ -24,12 +24,12 @@ struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { return 222; } + "f"_dyno = [](Foo&) { return 222; } ); template <> auto const dyno::concept_map = dyno::make_concept_map( - "g"_s = [](Foo&) { return 333; } + "g"_dyno = [](Foo&) { return 333; } ); int main() { @@ -37,16 +37,16 @@ int main() { { auto complete = dyno::complete_concept_map(dyno::concept_map); - DYNO_CHECK(complete["f"_s](foo) == 222); - DYNO_CHECK(complete["g"_s](foo) == 333); + DYNO_CHECK(complete["f"_dyno](foo) == 222); + DYNO_CHECK(complete["g"_dyno](foo) == 333); } { auto complete = dyno::complete_concept_map(dyno::concept_map); - DYNO_CHECK(complete["f"_s](foo) == 222); - DYNO_CHECK(complete["g"_s](foo) == 333); + DYNO_CHECK(complete["f"_dyno](foo) == 222); + DYNO_CHECK(complete["g"_dyno](foo) == 333); } { auto complete = dyno::complete_concept_map(dyno::concept_map); - DYNO_CHECK(complete["f"_s](foo) == 222); + DYNO_CHECK(complete["f"_dyno](foo) == 222); } } diff --git a/test/concept_map.ctor.default.cpp b/test/concept_map.ctor.default.cpp index defe3dc..21ed7ef 100644 --- a/test/concept_map.ctor.default.cpp +++ b/test/concept_map.ctor.default.cpp @@ -10,13 +10,13 @@ using namespace dyno::literals; struct A : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; int main() { - auto map = dyno::complete_concept_map(dyno::make_concept_map("f"_s = [](int&) { })); + auto map = dyno::complete_concept_map(dyno::make_concept_map("f"_dyno = [](int&) { })); (void)map; static_assert(std::is_default_constructible{}, ""); } diff --git a/test/concept_map.duplicate.fail.cpp b/test/concept_map.duplicate.fail.cpp index 92eb016..06ef496 100644 --- a/test/concept_map.duplicate.fail.cpp +++ b/test/concept_map.duplicate.fail.cpp @@ -8,14 +8,14 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; // MESSAGE[dyno::make_concept_map: It looks like you have multiple entries with the same name in your concept map] template <> auto dyno::concept_map = dyno::make_concept_map( - "f"_s = []() { }, - "f"_s = [](int) { } + "f"_dyno = []() { }, + "f"_dyno = [](int) { } ); int main() { } diff --git a/test/concept_map.fail.1.cpp b/test/concept_map.fail.1.cpp index 421cb16..d41a6b3 100644 --- a/test/concept_map.fail.1.cpp +++ b/test/concept_map.fail.1.cpp @@ -8,7 +8,7 @@ using namespace dyno::literals; struct Fooable : decltype(dyno::requires( - "foo"_s = dyno::function + "foo"_dyno = dyno::function )) { }; int main() { diff --git a/test/concept_map.fail.2.cpp b/test/concept_map.fail.2.cpp index 53b662a..ad4b8f1 100644 --- a/test/concept_map.fail.2.cpp +++ b/test/concept_map.fail.2.cpp @@ -8,17 +8,17 @@ using namespace dyno::literals; struct Fooable : decltype(dyno::requires( - "foo"_s = dyno::function + "foo"_dyno = dyno::function )) { }; template <> auto dyno::concept_map = dyno::make_concept_map( - "foo"_s = [](int& x) { ++x; } + "foo"_dyno = [](int& x) { ++x; } ); int main() { auto const& map = dyno::complete_concept_map(dyno::concept_map); // MESSAGE[Request for the implementation of a function that was not provided in the concept map] - auto bar = map["bar"_s]; + auto bar = map["bar"_dyno]; } diff --git a/test/concept_map.fail.3.cpp b/test/concept_map.fail.3.cpp index b6c0c51..833560d 100644 --- a/test/concept_map.fail.3.cpp +++ b/test/concept_map.fail.3.cpp @@ -8,13 +8,13 @@ using namespace dyno::literals; struct Fooable : decltype(dyno::requires( - "foo"_s = dyno::function, - "bar"_s = dyno::function + "foo"_dyno = dyno::function, + "bar"_dyno = dyno::function )) { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "foo"_s = [](int&) { } + "foo"_dyno = [](int&) { } ); // MESSAGE[Incomplete definition of your concept map] diff --git a/test/concept_map.invalid_default.cpp b/test/concept_map.invalid_default.cpp index c3a7348..d64c090 100644 --- a/test/concept_map.invalid_default.cpp +++ b/test/concept_map.invalid_default.cpp @@ -10,8 +10,8 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function, - "g"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function )) { }; // Since the definition of `f` would be invalid, we need to use a generic @@ -20,8 +20,8 @@ struct Concept : decltype(dyno::requires( template auto const dyno::default_concept_map = dyno::make_concept_map( - "f"_s = [](auto& t) { t.invalid(); return 222; }, - "g"_s = [](auto& t) { t.valid(); return 333; } + "f"_dyno = [](auto& t) { t.invalid(); return 222; }, + "g"_dyno = [](auto& t) { t.valid(); return 333; } ); struct Foo { @@ -31,12 +31,12 @@ struct Foo { template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { return 444; } + "f"_dyno = [](Foo&) { return 444; } ); int main() { Foo foo; auto complete = dyno::complete_concept_map(dyno::concept_map); - DYNO_CHECK(complete["f"_s](foo) == 444); - DYNO_CHECK(complete["g"_s](foo) == 333); + DYNO_CHECK(complete["f"_dyno](foo) == 444); + DYNO_CHECK(complete["g"_dyno](foo) == 333); } diff --git a/test/concept_map.models.cpp b/test/concept_map.models.cpp index e366788..d335f68 100644 --- a/test/concept_map.models.cpp +++ b/test/concept_map.models.cpp @@ -8,12 +8,12 @@ using namespace dyno::literals; struct A : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct B : decltype(dyno::requires( A{}, - "g"_s = dyno::function + "g"_dyno = dyno::function )) { }; struct C : decltype(dyno::requires(B{})) { }; @@ -23,12 +23,12 @@ struct Bar { }; struct Baz { }; template <> -auto const dyno::concept_map = dyno::make_concept_map("f"_s = [](Foo&) { }); +auto const dyno::concept_map = dyno::make_concept_map("f"_dyno = [](Foo&) { }); template <> -auto const dyno::concept_map = dyno::make_concept_map("g"_s = [](Foo&) { }); +auto const dyno::concept_map = dyno::make_concept_map("g"_dyno = [](Foo&) { }); template <> -auto const dyno::concept_map = dyno::make_concept_map("g"_s = [](Bar&) { }); +auto const dyno::concept_map = dyno::make_concept_map("g"_dyno = [](Bar&) { }); template <> auto const dyno::concept_map = dyno::make_concept_map(); diff --git a/test/concept_map.partial_default.cpp b/test/concept_map.partial_default.cpp index 5348ba1..e06fa3e 100644 --- a/test/concept_map.partial_default.cpp +++ b/test/concept_map.partial_default.cpp @@ -10,40 +10,40 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function, - "g"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function )) { }; template auto const dyno::default_concept_map = dyno::make_concept_map( - "f"_s = [](T&) { return 222; } + "f"_dyno = [](T&) { return 222; } ); struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "g"_s = [](Foo&) { return 333; } + "g"_dyno = [](Foo&) { return 333; } ); struct Bar { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Bar&) { return 444; }, - "g"_s = [](Bar&) { return 555; } + "f"_dyno = [](Bar&) { return 444; }, + "g"_dyno = [](Bar&) { return 555; } ); int main() { { Foo foo; auto complete = dyno::complete_concept_map(dyno::concept_map); - DYNO_CHECK(complete["f"_s](foo) == 222); - DYNO_CHECK(complete["g"_s](foo) == 333); + DYNO_CHECK(complete["f"_dyno](foo) == 222); + DYNO_CHECK(complete["g"_dyno](foo) == 333); } { Bar bar; auto complete = dyno::complete_concept_map(dyno::concept_map); - DYNO_CHECK(complete["f"_s](bar) == 444); - DYNO_CHECK(complete["g"_s](bar) == 555); + DYNO_CHECK(complete["f"_dyno](bar) == 444); + DYNO_CHECK(complete["g"_dyno](bar) == 555); } } diff --git a/test/concept_map.partial_override.cpp b/test/concept_map.partial_override.cpp index 03af9a2..4961bbb 100644 --- a/test/concept_map.partial_override.cpp +++ b/test/concept_map.partial_override.cpp @@ -13,25 +13,25 @@ using namespace dyno::literals; // that of a default concept map. struct Concept : decltype(dyno::requires( - "f"_s = dyno::function, - "g"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function )) { }; template auto const dyno::default_concept_map = dyno::make_concept_map( - "f"_s = [](T&) { return 222; } + "f"_dyno = [](T&) { return 222; } ); struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { return 555; }, - "g"_s = [](Foo&) { return 333; } + "f"_dyno = [](Foo&) { return 555; }, + "g"_dyno = [](Foo&) { return 333; } ); int main() { Foo foo; auto complete = dyno::complete_concept_map(dyno::concept_map); - DYNO_CHECK(complete["f"_s](foo) == 555); - DYNO_CHECK(complete["g"_s](foo) == 333); + DYNO_CHECK(complete["f"_dyno](foo) == 555); + DYNO_CHECK(complete["g"_dyno](foo) == 333); } diff --git a/test/detail/string.cpp b/test/detail/string.cpp index dd66860..89d517a 100644 --- a/test/detail/string.cpp +++ b/test/detail/string.cpp @@ -12,7 +12,7 @@ static auto foobar = DYNO_STRING("foobar"); using namespace dyno::literals; -static_assert(std::is_same{}, ""); +static_assert(std::is_same{}, ""); int main() { (void)foobar; diff --git a/test/poly.ctor.implicit.cpp b/test/poly.ctor.implicit.cpp index d7bef8e..10f6d44 100644 --- a/test/poly.ctor.implicit.cpp +++ b/test/poly.ctor.implicit.cpp @@ -15,8 +15,8 @@ using namespace dyno::literals; // construct from something that does not model the concept. struct Concept : decltype(dyno::requires( - "f"_s = dyno::function, - "g"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function )) { }; struct Foo { }; @@ -24,13 +24,13 @@ struct Bar { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { return 111; }, - "g"_s = [](Foo&) { return 888; } + "f"_dyno = [](Foo&) { return 111; }, + "g"_dyno = [](Foo&) { return 888; } ); template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { return 111; } + "f"_dyno = [](Foo&) { return 111; } // missing `g` to model the concept ); @@ -38,8 +38,8 @@ static_assert(std::is_convertible>{}, ""); static_assert(!std::is_convertible>{}, ""); void f(dyno::poly poly) { - DYNO_CHECK(poly.virtual_("f"_s)(poly) == 111); - DYNO_CHECK(poly.virtual_("g"_s)(poly) == 888); + DYNO_CHECK(poly.virtual_("f"_dyno)(poly) == 111); + DYNO_CHECK(poly.virtual_("g"_dyno)(poly) == 888); } int main() { diff --git a/test/poly.ctor.implicit.double_wrap.cpp b/test/poly.ctor.implicit.double_wrap.cpp index c9af812..72bd5ea 100644 --- a/test/poly.ctor.implicit.double_wrap.cpp +++ b/test/poly.ctor.implicit.double_wrap.cpp @@ -29,8 +29,8 @@ int main() { // We expect the objects below to be a copy of the above `poly` (and thus // `poly`s holding a `Foo`), not `poly`s holding a `poly`. dyno::poly explicit_copy{poly}; - DYNO_CHECK(explicit_copy.virtual_("typeid"_s)() == typeid(Foo)); + DYNO_CHECK(explicit_copy.virtual_("typeid"_dyno)() == typeid(Foo)); dyno::poly implicit_copy = poly; - DYNO_CHECK(implicit_copy.virtual_("typeid"_s)() == typeid(Foo)); + DYNO_CHECK(implicit_copy.virtual_("typeid"_dyno)() == typeid(Foo)); } diff --git a/test/poly.ctor.map.cpp b/test/poly.ctor.map.cpp index 660009a..df55a26 100644 --- a/test/poly.ctor.map.cpp +++ b/test/poly.ctor.map.cpp @@ -14,32 +14,32 @@ using namespace dyno::literals; // for a type at construction time. struct Concept : decltype(dyno::requires( - "f"_s = dyno::function, - "g"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { return 111; }, - "g"_s = [](Foo&) { return 888; } + "f"_dyno = [](Foo&) { return 111; }, + "g"_dyno = [](Foo&) { return 888; } ); int main() { { Foo foo; dyno::poly poly{foo}; - DYNO_CHECK(poly.virtual_("f"_s)(poly) == 111); - DYNO_CHECK(poly.virtual_("g"_s)(poly) == 888); + DYNO_CHECK(poly.virtual_("f"_dyno)(poly) == 111); + DYNO_CHECK(poly.virtual_("g"_dyno)(poly) == 888); } { Foo foo; dyno::poly poly{foo, dyno::make_concept_map( - "f"_s = [](Foo&) { return 222; } + "f"_dyno = [](Foo&) { return 222; } )}; - DYNO_CHECK(poly.virtual_("f"_s)(poly) == 222); - DYNO_CHECK(poly.virtual_("g"_s)(poly) == 888); + DYNO_CHECK(poly.virtual_("f"_dyno)(poly) == 222); + DYNO_CHECK(poly.virtual_("g"_dyno)(poly) == 888); } } diff --git a/test/poly.deref.cpp b/test/poly.deref.cpp index b040d58..6d2ecde 100644 --- a/test/poly.deref.cpp +++ b/test/poly.deref.cpp @@ -14,21 +14,21 @@ using namespace dyno::literals; // `dyno::poly::virtual_`. struct Concept : decltype(dyno::requires( - "f"_s = dyno::function, - "g"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { return 111; }, - "g"_s = [](Foo&, double d) { return d; } + "f"_dyno = [](Foo&) { return 111; }, + "g"_dyno = [](Foo&, double d) { return d; } ); int main() { Foo foo; dyno::poly poly{foo}; - DYNO_CHECK(poly->*"f"_s() == 111); - DYNO_CHECK(poly->*"g"_s(3.3) == 3.3); + DYNO_CHECK(poly->*"f"_dyno() == 111); + DYNO_CHECK(poly->*"g"_dyno(3.3) == 3.3); } diff --git a/test/poly.deref.fail.cpp b/test/poly.deref.fail.cpp index 853fb22..2acc8f2 100644 --- a/test/poly.deref.fail.cpp +++ b/test/poly.deref.fail.cpp @@ -11,20 +11,20 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&, double) { return 111; } + "f"_dyno = [](Foo&, double) { return 111; } ); int main() { Foo foo; dyno::poly poly{foo}; // can't store this in a variable; can only use as a temporary - auto f = "f"_s(3.3); + auto f = "f"_dyno(3.3); poly->*f; } diff --git a/test/poly.remote.size.cpp b/test/poly.remote.size.cpp index 162021e..057f970 100644 --- a/test/poly.remote.size.cpp +++ b/test/poly.remote.size.cpp @@ -12,7 +12,7 @@ using namespace dyno::literals; // where the size was more than that. struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; using Storage = dyno::remote_storage; diff --git a/test/poly.virtual.cpp b/test/poly.virtual.cpp index 809a5e8..5883b56 100644 --- a/test/poly.virtual.cpp +++ b/test/poly.virtual.cpp @@ -15,48 +15,48 @@ using namespace dyno::literals; // pass a `dyno::poly`, and it gets translated to a `void*` internally. struct Concept : decltype(dyno::requires( - "a"_s = dyno::function, - "b"_s = dyno::function, - "c"_s = dyno::function, - "d"_s = dyno::function, - "e"_s = dyno::function + "a"_dyno = dyno::function, + "b"_dyno = dyno::function, + "c"_dyno = dyno::function, + "d"_dyno = dyno::function, + "e"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "a"_s = [](Foo&) { return 111; }, - "b"_s = [](Foo&&) { return 222; }, - "c"_s = [](Foo*) { return 333; }, - "d"_s = [](Foo const&) { return 444; }, - "e"_s = [](Foo const*) { return 555; } + "a"_dyno = [](Foo&) { return 111; }, + "b"_dyno = [](Foo&&) { return 222; }, + "c"_dyno = [](Foo*) { return 333; }, + "d"_dyno = [](Foo const&) { return 444; }, + "e"_dyno = [](Foo const*) { return 555; } ); int main() { { Foo foo; dyno::poly poly{foo}; - DYNO_CHECK(poly.virtual_("a"_s)(poly) == 111); + DYNO_CHECK(poly.virtual_("a"_dyno)(poly) == 111); } { Foo foo; dyno::poly poly{foo}; - DYNO_CHECK(poly.virtual_("b"_s)(std::move(poly)) == 222); + DYNO_CHECK(poly.virtual_("b"_dyno)(std::move(poly)) == 222); } { Foo foo; dyno::poly poly{foo}; - DYNO_CHECK(poly.virtual_("c"_s)(&poly) == 333); + DYNO_CHECK(poly.virtual_("c"_dyno)(&poly) == 333); } { Foo foo; dyno::poly const poly{foo}; - DYNO_CHECK(poly.virtual_("d"_s)(poly) == 444); + DYNO_CHECK(poly.virtual_("d"_dyno)(poly) == 444); } { Foo foo; dyno::poly const poly{foo}; - DYNO_CHECK(poly.virtual_("e"_s)(&poly) == 555); + DYNO_CHECK(poly.virtual_("e"_dyno)(&poly) == 555); } } diff --git a/test/poly.virtual.fail.1.cpp b/test/poly.virtual.fail.1.cpp index bae8662..d9d14ac 100644 --- a/test/poly.virtual.fail.1.cpp +++ b/test/poly.virtual.fail.1.cpp @@ -11,19 +11,19 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo*) { return 111; } + "f"_dyno = [](Foo*) { return 111; } ); int main() { Foo foo; dyno::poly poly{foo}; // MESSAGE[dyno::poly::virtual_: Passing a non-poly object as an argument] - DYNO_CHECK(poly.virtual_("f"_s)(static_cast(&poly)) == 111); + DYNO_CHECK(poly.virtual_("f"_dyno)(static_cast(&poly)) == 111); } diff --git a/test/poly.virtual.fail.2.cpp b/test/poly.virtual.fail.2.cpp index ead37b1..26cecd7 100644 --- a/test/poly.virtual.fail.2.cpp +++ b/test/poly.virtual.fail.2.cpp @@ -11,19 +11,19 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { return 111; } + "f"_dyno = [](Foo&) { return 111; } ); int main() { Foo foo; dyno::poly poly{foo}; // MESSAGE[dyno::poly::virtual_: Passing a non-poly object as an argument] - DYNO_CHECK(poly.virtual_("f"_s)(foo) == 111); + DYNO_CHECK(poly.virtual_("f"_dyno)(foo) == 111); } diff --git a/test/poly.virtual.fail.3.cpp b/test/poly.virtual.fail.3.cpp index 0e56217..051ce59 100644 --- a/test/poly.virtual.fail.3.cpp +++ b/test/poly.virtual.fail.3.cpp @@ -9,19 +9,19 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { } + "f"_dyno = [](Foo&) { } ); int main() { Foo foo; dyno::poly poly{foo}; // MESSAGE[dyno::poly::virtual_: Trying to access a function that is not part of the Concept] - poly.virtual_("g"_s); + poly.virtual_("g"_dyno); } diff --git a/test/poly.virtual.method.cpp b/test/poly.virtual.method.cpp index 5b916ef..ffb7fd6 100644 --- a/test/poly.virtual.method.cpp +++ b/test/poly.virtual.method.cpp @@ -15,48 +15,48 @@ using namespace dyno::literals; // `function`. struct Concept : decltype(dyno::requires( - "a"_s = dyno::method, - "b"_s = dyno::method, - "c"_s = dyno::method, - "d"_s = dyno::method, - "e"_s = dyno::method + "a"_dyno = dyno::method, + "b"_dyno = dyno::method, + "c"_dyno = dyno::method, + "d"_dyno = dyno::method, + "e"_dyno = dyno::method )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "a"_s = [](Foo&, int) { return 111; }, - "b"_s = [](Foo&, int) { return 222; }, - "c"_s = [](Foo&&, int) { return 333; }, - "d"_s = [](Foo const&, int) { return 444; }, - "e"_s = [](Foo const&, int) { return 555; } + "a"_dyno = [](Foo&, int) { return 111; }, + "b"_dyno = [](Foo&, int) { return 222; }, + "c"_dyno = [](Foo&&, int) { return 333; }, + "d"_dyno = [](Foo const&, int) { return 444; }, + "e"_dyno = [](Foo const&, int) { return 555; } ); int main() { { Foo foo; dyno::poly poly{foo}; - DYNO_CHECK(poly.virtual_("a"_s)(int{}) == 111); + DYNO_CHECK(poly.virtual_("a"_dyno)(int{}) == 111); } { Foo foo; dyno::poly poly{foo}; - DYNO_CHECK(poly.virtual_("b"_s)(int{}) == 222); + DYNO_CHECK(poly.virtual_("b"_dyno)(int{}) == 222); } { Foo foo; dyno::poly poly{foo}; - DYNO_CHECK(std::move(poly).virtual_("c"_s)(int{}) == 333); + DYNO_CHECK(std::move(poly).virtual_("c"_dyno)(int{}) == 333); } { Foo foo; dyno::poly const poly{foo}; - DYNO_CHECK(poly.virtual_("d"_s)(int{}) == 444); + DYNO_CHECK(poly.virtual_("d"_dyno)(int{}) == 444); } { Foo foo; dyno::poly const poly{foo}; - DYNO_CHECK(poly.virtual_("e"_s)(int{}) == 555); + DYNO_CHECK(poly.virtual_("e"_dyno)(int{}) == 555); } } diff --git a/test/vtable.cv.cpp b/test/vtable.cv.cpp index 6f46052..84617fb 100644 --- a/test/vtable.cv.cpp +++ b/test/vtable.cv.cpp @@ -16,26 +16,26 @@ using namespace dyno::literals; // struct Concept : decltype(dyno::requires( - "f1"_s = dyno::function, - "f2"_s = dyno::function, - "f3"_s = dyno::function, - "f4"_s = dyno::function, - "f5"_s = dyno::function, - "f6"_s = dyno::function, - "f7"_s = dyno::function + "f1"_dyno = dyno::function, + "f2"_dyno = dyno::function, + "f3"_dyno = dyno::function, + "f4"_dyno = dyno::function, + "f5"_dyno = dyno::function, + "f6"_dyno = dyno::function, + "f7"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f1"_s = [](Foo const&) { return 111; }, - "f2"_s = [](Foo const*) { return 222; }, - "f3"_s = [](Foo volatile&) { return 333; }, - "f4"_s = [](Foo volatile*) { return 444; }, - "f5"_s = [](Foo const volatile&) { return 555; }, - "f6"_s = [](Foo const volatile*) { return 666; }, - "f7"_s = [](Foo&, int const&) { return 777; } + "f1"_dyno = [](Foo const&) { return 111; }, + "f2"_dyno = [](Foo const*) { return 222; }, + "f3"_dyno = [](Foo volatile&) { return 333; }, + "f4"_dyno = [](Foo volatile*) { return 444; }, + "f5"_dyno = [](Foo const volatile&) { return 555; }, + "f6"_dyno = [](Foo const volatile*) { return 666; }, + "f7"_dyno = [](Foo&, int const&) { return 777; } ); int main() { @@ -44,11 +44,11 @@ int main() { Foo foo; int i = 0; - DYNO_CHECK(vtable["f1"_s](&foo) == 111); // erased as a void* - DYNO_CHECK(vtable["f2"_s](&foo) == 222); // erased as a void* - DYNO_CHECK(vtable["f3"_s](&foo) == 333); // erased as a void* - DYNO_CHECK(vtable["f4"_s](&foo) == 444); // erased as a void* - DYNO_CHECK(vtable["f5"_s](&foo) == 555); // erased as a void* - DYNO_CHECK(vtable["f6"_s](&foo) == 666); // erased as a void* - DYNO_CHECK(vtable["f7"_s](&foo, i) == 777); + DYNO_CHECK(vtable["f1"_dyno](&foo) == 111); // erased as a void* + DYNO_CHECK(vtable["f2"_dyno](&foo) == 222); // erased as a void* + DYNO_CHECK(vtable["f3"_dyno](&foo) == 333); // erased as a void* + DYNO_CHECK(vtable["f4"_dyno](&foo) == 444); // erased as a void* + DYNO_CHECK(vtable["f5"_dyno](&foo) == 555); // erased as a void* + DYNO_CHECK(vtable["f6"_dyno](&foo) == 666); // erased as a void* + DYNO_CHECK(vtable["f7"_dyno](&foo, i) == 777); } diff --git a/test/vtable.fail.1.cpp b/test/vtable.fail.1.cpp index ea1e7d6..5168e85 100644 --- a/test/vtable.fail.1.cpp +++ b/test/vtable.fail.1.cpp @@ -9,25 +9,25 @@ using namespace dyno::literals; struct Fooable : decltype(dyno::requires( - "a"_s = dyno::function, - "b"_s = dyno::function + "a"_dyno = dyno::function, + "b"_dyno = dyno::function )) { }; template <> auto dyno::concept_map = dyno::make_concept_map( - "a"_s = [](int&) { }, - "b"_s = [](int&) { } + "a"_dyno = [](int&) { }, + "b"_dyno = [](int&) { } ); int main() { using VTable = dyno::vtable< - dyno::local>, - dyno::remote> + dyno::local>, + dyno::remote> >; VTable::apply vtable{ dyno::complete_concept_map(dyno::concept_map) }; // MESSAGE[Request for a virtual function that is not present in any of the joined vtables] - auto fail = vtable["inexistent"_s]; + auto fail = vtable["inexistent"_dyno]; } diff --git a/test/vtable.fail.2.cpp b/test/vtable.fail.2.cpp index baff8fd..e5f9549 100644 --- a/test/vtable.fail.2.cpp +++ b/test/vtable.fail.2.cpp @@ -9,14 +9,14 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { } + "f"_dyno = [](Foo&) { } ); int main() { diff --git a/test/vtable.fail.3.cpp b/test/vtable.fail.3.cpp index 04555bf..065f566 100644 --- a/test/vtable.fail.3.cpp +++ b/test/vtable.fail.3.cpp @@ -9,21 +9,21 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function, - "g"_s = dyno::function + "f"_dyno = dyno::function, + "g"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { }, - "g"_s = [](Foo&) { } + "f"_dyno = [](Foo&) { }, + "g"_dyno = [](Foo&) { } ); int main() { auto complete = dyno::complete_concept_map(dyno::concept_map); // MESSAGE[The policies specified in the vtable did not fully cover all the functions provided by the concept] - dyno::vtable>>::apply vtable{complete}; + dyno::vtable>>::apply vtable{complete}; } diff --git a/test/vtable.fail.4.cpp b/test/vtable.fail.4.cpp index 4a29d66..d7c3b6c 100644 --- a/test/vtable.fail.4.cpp +++ b/test/vtable.fail.4.cpp @@ -9,14 +9,14 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { } + "f"_dyno = [](Foo&) { } ); int main() { @@ -24,7 +24,7 @@ int main() { // MESSAGE[Some functions specified in this selector are not part of the concept to which the selector was applied] dyno::vtable< - dyno::local>, + dyno::local>, dyno::remote >::apply vtable{complete}; } diff --git a/test/vtable.fail.5.cpp b/test/vtable.fail.5.cpp index ce52d04..cc6baaf 100644 --- a/test/vtable.fail.5.cpp +++ b/test/vtable.fail.5.cpp @@ -9,14 +9,14 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { } + "f"_dyno = [](Foo&) { } ); int main() { @@ -24,7 +24,7 @@ int main() { // MESSAGE[Some functions specified in this selector are not part of the concept to which the selector was applied] dyno::vtable< - dyno::local>, + dyno::local>, dyno::remote >::apply vtable{complete}; } diff --git a/test/vtable.fail.6.cpp b/test/vtable.fail.6.cpp index dce47cd..662d0eb 100644 --- a/test/vtable.fail.6.cpp +++ b/test/vtable.fail.6.cpp @@ -9,12 +9,12 @@ using namespace dyno::literals; struct Fooable : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; template <> auto dyno::concept_map = dyno::make_concept_map( - "f"_s = [](int&) { } + "f"_dyno = [](int&) { } ); int main() { @@ -23,5 +23,5 @@ int main() { }; // MESSAGE[Request for a virtual function that is not in the vtable] - auto fail = vtable["inexistent"_s]; + auto fail = vtable["inexistent"_dyno]; } diff --git a/test/vtable.selector.compress.cpp b/test/vtable.selector.compress.cpp index b5c5a8e..4fad4f3 100644 --- a/test/vtable.selector.compress.cpp +++ b/test/vtable.selector.compress.cpp @@ -14,7 +14,7 @@ using namespace dyno::literals; // easy to optimize as possible. struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; @@ -25,7 +25,7 @@ using GeneratedVTable = dyno::vtable< >::apply; using RemoteOnly = dyno::remote_vtable) + decltype("f"_dyno = dyno::function) >>; static_assert(std::is_same{}); diff --git a/test/vtable.selector.fail.1.cpp b/test/vtable.selector.fail.1.cpp index 684c055..37e9dbd 100644 --- a/test/vtable.selector.fail.1.cpp +++ b/test/vtable.selector.fail.1.cpp @@ -9,14 +9,14 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { } + "f"_dyno = [](Foo&) { } ); int main() { diff --git a/test/vtable.selector.fail.2.cpp b/test/vtable.selector.fail.2.cpp index 3c29e72..9f26a4c 100644 --- a/test/vtable.selector.fail.2.cpp +++ b/test/vtable.selector.fail.2.cpp @@ -9,14 +9,14 @@ using namespace dyno::literals; struct Concept : decltype(dyno::requires( - "f"_s = dyno::function + "f"_dyno = dyno::function )) { }; struct Foo { }; template <> auto const dyno::concept_map = dyno::make_concept_map( - "f"_s = [](Foo&) { } + "f"_dyno = [](Foo&) { } ); int main() { @@ -24,7 +24,7 @@ int main() { // MESSAGE[dyno::remote: Provided invalid selector. Valid selectors are] dyno::vtable< - dyno::local>, + dyno::local>, dyno::remote >::apply vtable{complete}; }