This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<boost/hana.hpp> | |
#include<vector> | |
#include<iostream> | |
namespace hana = boost::hana; | |
struct Tag1 {}; | |
struct Tag2 {}; | |
struct Tag3 {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<boost/hana.hpp> | |
namespace hana = boost::hana; | |
constexpr auto my_sequence = hana::tuple_t<int, float, char>; | |
constexpr auto my_sequence_reversed = hana::tuple_t<char, float, int>; | |
static_assert(hana::reverse(my_sequence) == my_sequence_reversed, ""); | |
int main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<string> | |
#include<nbdl> | |
#include "catch.hpp" | |
TEST_CASE("Unitialized variant should match Unresolved.", "[variant]") | |
{ | |
using Number = nbdl::Variant<int, std::string, float>; | |
Number number; | |
REQUIRE(number.match( | |
[](nbdl::Unresolved) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<nbdl> | |
#include "catch.hpp" | |
struct Type1 {}; | |
struct Type2 {}; | |
struct Type3 {}; | |
struct Type4 {}; | |
template<typename T> | |
int getInt(T tag) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
template<typename T> | |
struct LambdaTraits | |
{ | |
using ReturnType = typename LambdaTraits<decltype(&T::operator())>::ReturnType; | |
}; | |
template<typename ClassType, typename Return, typename... Args> | |
struct LambdaTraits<Return(ClassType::*)(Args...) const> | |
{ |
NewerOlder