Commit cf11f657 authored by Paul's avatar Paul
Browse files

Formatting

parent 13a9d276
......@@ -128,10 +128,7 @@ struct operation
return std::make_shared<private_detail_te_handle_type>(private_detail_te_value);
}
const std::type_info& type() const override
{
return typeid(private_detail_te_value);
}
const std::type_info& type() const override { return typeid(private_detail_te_value); }
std::string name() const override { return private_detail_te_value.name(); }
......
......@@ -21,20 +21,23 @@ void operation_copy_test()
EXPECT(op2.name() == op1.name());
}
struct not_operation {};
struct not_operation
{
};
void operation_any_cast()
{
rtg::operation op1 = simple_operation{};
EXPECT(rtg::any_cast<simple_operation>(op1).data == 1);
EXPECT(rtg::any_cast<not_operation*>(&op1) == nullptr);
EXPECT(test::throws([&]{ rtg::any_cast<not_operation&>(op1); }));
EXPECT(test::throws([&] { rtg::any_cast<not_operation&>(op1); }));
rtg::operation op2 = simple_operation{2};
EXPECT(rtg::any_cast<simple_operation>(op2).data == 2);
EXPECT(rtg::any_cast<not_operation*>(&op2) == nullptr);
}
int main() {
int main()
{
operation_copy_test();
operation_any_cast();
}
......@@ -27,7 +27,6 @@ namespace test {
TEST_FOREACH_OPERATOR(TEST_EACH_OPERATOR_OBJECT)
inline std::ostream& operator<<(std::ostream& s, std::nullptr_t)
{
s << "nullptr";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment