Skip to content

Commit

Permalink
Use no declaration instead of static assert for compilers that evalua…
Browse files Browse the repository at this point in the history
…te it even when not used.

(cherry picked from commit 73b3d40)
  • Loading branch information
StefanFabian committed Jan 6, 2025
1 parent b709bf1 commit 36a9d9a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ros_babel_fish/include/ros_babel_fish/messages/message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ class Message
* type which is the case for bool, std::string, ros::Time and ros::Duration
*/
template<typename T>
T value() const
{
// Fallback to the default implementation which throws an exception if no specialization is available
static_assert( false && "Invalid type for value!" );
}
T value() const; // Only specializations available

/*!
* Convenience method that casts the message to the given type.
Expand Down

0 comments on commit 36a9d9a

Please sign in to comment.