This file contains 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
// ==================== 1) Overload Catch::toString | |
struct ts_overload { }; // have an overload of toString | |
namespace Catch { | |
std::string toString( const ts_overload& ) | |
{ | |
return "ts:ts_overload"; | |
} | |
} |
This file contains 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 <type_traits> | |
#include <limits> | |
#include <cstdint> | |
namespace detail { | |
template<std::uintmax_t Value> | |
constexpr std::uintmax_t parse_unsigned_literal() | |
{ | |
return Value; |
This file contains 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
for( auto& element : elements ) | |
{ | |
if( auto c = std::dynamic_pointer_cast<C>( element ) ) | |
{ | |
c->BehaveLikeC(); | |
} | |
if( auto d = std::dynamic_pointer_cast<D>( element ) ) | |
{ | |
DoSomething(d); |