Sparkplug B C++ Library
1.0.0
Modern C++-23 implementation of Eclipse Sparkplug B 2.2 specification
Loading...
Searching...
No Matches
compat.hpp
1
#pragma once
2
3
// Compatibility layer for C++23 features
4
// Provides fallbacks for older compilers that lack full C++23 stdlib support
5
6
// std::expected compatibility
7
// Feature test macro from: https://en.cppreference.com/w/cpp/feature_test
8
#if __cpp_lib_expected >= 202202L
9
// Compiler has C++23 std::expected in stdlib
10
# include <expected>
11
namespace
sparkplug::stdx {
12
using
std::expected;
13
using
std::unexpected;
14
}
// namespace sparkplug::stdx
15
#else
16
// Fallback to tl::expected for older compilers (e.g., Ubuntu 24.04 LTS)
17
# include <tl/expected.hpp>
18
namespace
sparkplug::stdx {
19
using
tl::expected;
20
using
tl::unexpected;
21
}
// namespace sparkplug::stdx
22
#endif
include
sparkplug
detail
compat.hpp
Generated on Sun Dec 7 2025 05:33:41 for Sparkplug B C++ Library by
1.9.8