rsl  1.1.0
ROS Support Library
try.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <tl_expected/expected.hpp>
4 
30 #define TRY(expected) \
31  ({ \
32  auto const& _expected = (expected); /* Uglify name to prevent shadowing */ \
33  if (!_expected.has_value()) return tl::unexpected(_expected.error()); \
34  _expected.value(); \
35  })