diff --git a/src/scheme/DiscreteFunctionP0.hpp b/src/scheme/DiscreteFunctionP0.hpp index fa95c4e1bba54c8ba1c623e67d2774313c85617b..df64472fe6281f06ccdb32148f3e0bd596216710 100644 --- a/src/scheme/DiscreteFunctionP0.hpp +++ b/src/scheme/DiscreteFunctionP0.hpp @@ -19,6 +19,9 @@ class DiscreteFunctionP0 : public IDiscreteFunction static constexpr HandledItemDataType handled_data_type = HandledItemDataType::value; + friend class DiscreteFunctionP0<Dimension, std::add_const_t<DataType>>; + friend class DiscreteFunctionP0<Dimension, std::remove_const_t<DataType>>; + private: std::shared_ptr<const MeshType> m_mesh; CellValue<DataType> m_cell_values; diff --git a/src/scheme/DiscreteFunctionP0Vector.hpp b/src/scheme/DiscreteFunctionP0Vector.hpp index f4ccc7d3c3395d5c2c070f7ab3464cd0561b9344..d689258f88f7139fc05bd16ba11307338607e578 100644 --- a/src/scheme/DiscreteFunctionP0Vector.hpp +++ b/src/scheme/DiscreteFunctionP0Vector.hpp @@ -22,6 +22,9 @@ class DiscreteFunctionP0Vector : public IDiscreteFunction static constexpr HandledItemDataType handled_data_type = HandledItemDataType::vector; + friend class DiscreteFunctionP0Vector<Dimension, std::add_const_t<DataType>>; + friend class DiscreteFunctionP0Vector<Dimension, std::remove_const_t<DataType>>; + static_assert(std::is_arithmetic_v<DataType>, "DiscreteFunctionP0Vector are only defined for arithmetic data type"); private: diff --git a/tests/test_DiscreteFunctionDescriptorP0.cpp b/tests/test_DiscreteFunctionDescriptorP0.cpp index 3cc11f7d4ab4cf9ceb5a9e76b32b86f1eb18214a..2f80bd84e36ee1a5d18b1682ec2f2cbe35203d90 100644 --- a/tests/test_DiscreteFunctionDescriptorP0.cpp +++ b/tests/test_DiscreteFunctionDescriptorP0.cpp @@ -19,7 +19,8 @@ TEST_CASE("DiscreteFunctionDescriptorP0", "[scheme]") REQUIRE(descriptor_copy.type() == DiscreteFunctionType::P0); } - DiscreteFunctionDescriptorP0 descriptor_move{std::move(DiscreteFunctionDescriptorP0{})}; + DiscreteFunctionDescriptorP0 temp; + DiscreteFunctionDescriptorP0 descriptor_move{std::move(temp)}; REQUIRE(descriptor_move.type() == DiscreteFunctionType::P0); } } diff --git a/tests/test_DiscreteFunctionDescriptorP0Vector.cpp b/tests/test_DiscreteFunctionDescriptorP0Vector.cpp index 4aa605ec41d99d9d58511c7824eb78d37dd2734f..5caa63b236c3414aef6ee46668c73b0b0c3f6e3f 100644 --- a/tests/test_DiscreteFunctionDescriptorP0Vector.cpp +++ b/tests/test_DiscreteFunctionDescriptorP0Vector.cpp @@ -19,7 +19,8 @@ TEST_CASE("DiscreteFunctionDescriptorP0Vector", "[scheme]") REQUIRE(descriptor_copy.type() == DiscreteFunctionType::P0Vector); } - DiscreteFunctionDescriptorP0Vector descriptor_move{std::move(DiscreteFunctionDescriptorP0Vector{})}; + DiscreteFunctionDescriptorP0Vector temp; + DiscreteFunctionDescriptorP0Vector descriptor_move{std::move(temp)}; REQUIRE(descriptor_move.type() == DiscreteFunctionType::P0Vector); } }