[Dune] Template alias with Dune::FieldVector

Steffen Müthing steffen.muething at iwr.uni-heidelberg.de
Thu Aug 8 17:56:40 CEST 2013


Hi Martin,

Am 08.08.2013 um 17:47 schrieb Martin Rückl:

> Hi Dune team /  Dune users,
> my question might be unrelated to Dune itself, but i thought i ask here first. In my code i use the new template
> alias syntax introduces with c++11 and up to now everything worked well. Now i stumbled above an issue with the following snipplet of code:
> 
> template<unsigned Channels>
> class Foo
> {
> template<typename T>
> using ChannelDataContainer = Dune::FieldVector<T,Channels /* +1 */>; // if I add the plus one, everything works
> }
> 
> for instantiations where Channels>1 everything works fine. however for Channels==1 gcc 4.7.2 quits with: "internal compiler error: in retrieve_specialization, at cp/pt.c:1014".
> Obviously this is an issue with gcc failing to retrieve specialization for FieldVector, I'm just wondering if any of you have experienced the same problems and found a pretty work around.

congratulations, looks like you found a GCC bug! ;-). The only workaround I see out of the blue would be to insert a traditional selection struct like this:

template<typename T>
struct CDCSelector
{
  typedef … type;
};

and to use that in the template alias. Maybe that will help…

Best of luck,
Steffen

> 
> Greetings,
> Martin Rückl
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20130808/468c7157/attachment.sig>


More information about the Dune mailing list