diff --git a/include/rfl/internal/to_ptr_field.hpp b/include/rfl/internal/to_ptr_field.hpp index 38249dad..0db97cc3 100644 --- a/include/rfl/internal/to_ptr_field.hpp +++ b/include/rfl/internal/to_ptr_field.hpp @@ -13,39 +13,18 @@ namespace internal { template inline auto to_ptr_field(Field<_name, Type>& _field) { - if constexpr (std::is_pointer_v) { - static_assert(always_false_v, - "Writing from raw pointers is dangerous and " - "therefore unsupported. " - "Please consider using std::unique_ptr, rfl::Box, " - "std::shared_ptr, rfl::Ref or std::optional instead."); - } using T = std::remove_reference_t; return Field<_name, T*>(&_field.value_); } template inline auto to_ptr_field(const Field<_name, Type>& _field) { - if constexpr (std::is_pointer_v) { - static_assert(always_false_v, - "Writing from raw pointers is dangerous and " - "therefore unsupported. " - "Please consider using std::unique_ptr, rfl::Box, " - "std::shared_ptr, rfl::Ref or std::optional instead."); - } using T = std::remove_cvref_t; return Field<_name, const T*>(&_field.value_); } template inline auto to_ptr_field(Flatten& _field) { - if constexpr (std::is_pointer_v) { - static_assert(always_false_v, - "Writing from raw pointers is dangerous and " - "therefore unsupported. " - "Please consider using std::unique_ptr, rfl::Box, " - "std::shared_ptr, rfl::Ref or std::optional instead."); - } using T = std::remove_reference_t; return Flatten(&_field.value_); }