Skip to content

Commit 2948b48

Browse files
authored
Redirect tl_expected to system libexpected-dev when available (#12)
1 parent 2440af8 commit 2948b48

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

tl_expected/include/tl_expected/expected.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
// <http://creativecommons.org/publicdomain/zero/1.0/>.
1414
///
1515

16+
#warning "tl_expected/expected.hpp is deprecated. Use <tl/expected.hpp> from libexpected-dev, or <rcpputils/tl_expected/expected.hpp> if the system header is not available."
17+
// If the system header is available, redirect to it.
18+
// Otherwise, fall back to the vendored version
19+
#if __has_include(<tl/expected.hpp>)
20+
#include <tl/expected.hpp>
21+
#else
1622
#ifndef TL_EXPECTED_HPP
1723
#define TL_EXPECTED_HPP
1824

@@ -2480,4 +2486,6 @@ void swap(expected<T, E> &lhs,
24802486
}
24812487
} // namespace tl
24822488

2483-
#endif
2489+
#endif // TL_EXPECTED_HPP
2490+
2491+
#endif // !defined(USE_VENDORED_TL_EXPECTED) && __has_include(<tl/expected.hpp>)

tl_expected/package.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
<buildtool_depend>ament_cmake</buildtool_depend>
1818

19+
<build_export_depend>libexpected-dev</build_export_depend>
20+
1921
<export>
2022
<build_type>ament_cmake</build_type>
2123
</export>

0 commit comments

Comments
 (0)