[Dune-devel] [Dune-Commit] [Commit] dune-grid - db187f4: [YaspGrid] Fix compilation problem on GCC 4.4

Steffen Müthing steffen.muething at iwr.uni-heidelberg.de
Mon Sep 29 17:47:12 CEST 2014


Am 29.09.2014 um 17:39 schrieb Markus Blatt <markus at dr-blatt.de>:

> On Mon, Sep 29, 2014 at 03:39:01PM +0200, Steffen Müthing wrote:
>>       std::bitset<dim> operator()(int index, int cc) const
>>       {
>> -        std::bitset<dim> result(0);
>> +        std::bitset<dim> result(0ull);
> 
> I already said this on other occasions and will repeat myself over an
> over again: 
> Why such cryptic instantiations? Is there anything wrong with using the
> default zero initialization:

I don’t care either way, but Dominic preferred this because that way the user
doesn’t have to know that default-initialization of a std::bitset results in all bits
set to false. I thought that was a valid argument (even though I had initially
switched to the default constructor as well). What you’d really want is a constructor
that takes a bool (I think that’s in C++14).

> 
> std::bitset<dim> result();

That’s not gonna fly - the compiler will just mock you with an incomprehensible error
message because it parses the thing as a function signature ;-)

std::bitset<dim> result;

is what you want.

Steffen

> 
> Markus
> -- 
> Do you need more support with DUNE or HPC in general? 
> 
> Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
> Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
> Tel.: +49 (0) 160 97590858
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel

-------------- 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-devel/attachments/20140929/8b745763/attachment.sig>


More information about the Dune-devel mailing list