bt2::CommonEnumerationFieldClass::addMapping(): add missing static assertion
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 18 Mar 2024 21:20:34 +0000 (17:20 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 25 Apr 2024 17:50:43 +0000 (13:50 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ie5a90126d0c25c92f00dce0af962f1e64048bdbc
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12481
CI-Build: Simon Marchi <simon.marchi@efficios.com>

src/cpp-common/bt2/field-class.hpp

index 83cd52157cc4af723e6bc895817a52204e193cee..71e32e411d2d43cb5d19ed411b41383aa82488bc 100644 (file)
@@ -864,6 +864,9 @@ public:
     CommonEnumerationFieldClass addMapping(const bt2c::CStringView label,
                                            const typename Mapping::RangeSet ranges) const
     {
+        static_assert(!std::is_const<LibObjT>::value,
+                      "Not available with `bt2::Const*EnumerationFieldClass`.");
+
         const auto status = internal::CommonEnumerationFieldClassSpec<MappingT>::addMapping(
             this->libObjPtr(), label, ranges.libObjPtr());
 
This page took 0.026085 seconds and 4 git commands to generate.