We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfa90bc commit f7a1b35Copy full SHA for f7a1b35
include/behaviortree_cpp_v3/utils/safe_any.hpp
@@ -92,6 +92,7 @@ class Any
92
template <typename T>
93
explicit Any(const T& value, EnableNonIntegral<T> = 0) : _any(value), _original_type( &typeid(T) )
94
{
95
+ static_assert(!std::is_reference_v<T>, "Any can not contain references");
96
}
97
98
Any& operator = (const Any& other)
@@ -118,6 +119,8 @@ class Any
118
119
120
T cast() const
121
122
+ static_assert(!std::is_reference_v<T>, "Any::cast uses value semantic, can not cast to reference");
123
+
124
if( _any.empty() )
125
126
throw std::runtime_error("Any::cast failed because it is empty");
0 commit comments