[dune-functions] More build failures
Carsten Gräser
graeser at mi.fu-berlin.de
Fri Sep 18 13:59:58 CEST 2015
Hi,
[...]
> Ups, you are right... but the error is still the same
> in-class initializer for static data member is not a constant expression
> static const int value = ((const typename std::decay<T>::type*)(nullptr))->size();
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
it's really hard to call a constexpr method if you don't
have an object. After digging some more time it seems that
the only possible way is to call a constructor inside of
decltype. Unfortunately the constructor arguments are not
known. Maybe it's OK to restrict this to default-constructible
types. I'll have look.
Best,
Carsten
BTW:
As it turns out calling a constexpr member function
gives only a constexpr if the type is literal. Hence
calling size() for a FieldVector is not constexpr
because FieldVector is not literal. Maybe we can change this
by declaring the default constructor constexpr.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-functions/attachments/20150918/02223161/attachment.sig>
More information about the dune-functions
mailing list