Hello,
Seeking advice on DuMux's (DUNE's) mechanism of type tags and
properties. Probably I misinterpret this part of the Handbook:
If you call GetProp the property system will first look for the
properties defined in BaseTagName1 in the InheritsFrom list. If a
defined property is found this property is returned. If no defined
property is found the search will continue in the ancestors of
BaseTagName1. If again no defined property is found the search will
continue in the second BaseTagName2 in the list, and so on. If no
defined property is found at all, a compiler error is triggered.
I assume that the following code will yield the positive value of the
TestProperty. The "default" value is false, but TestTag3 inherits
TestTag1 where the value is true.
namespace Dumux {
namespace Properties {
namespace TTag {
struct TestTag1 { };
struct TestTag2 { };
struct TestTag3
{ using InheritsFrom = std::tuple<TestTag1, TestTag2>; };
template<class TypeTag, class MyTypeTag>
struct TestProperty {
static constexpr bool value = false; };
template<class TypeTag>
struct TestProperty<TypeTag, TTag::TestTag1> {
static constexpr bool value = true; };
} } }
....
static constexpr bool testprop =
GetProp<Properties::TTag::TestTag3,
Properties::TTag::TestProperty>::value;
std::cout << "testprop is " << testprop << "\n";
Yet it prints
testprop is 0
What am I missing?
Best regards,
Dmitry
_______________________________________________
DuMux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux