On Monday, 19 January 2015 at 16:12:59 UTC, Luc Bourhis wrote:
Thanks everybody for your help!
Just one point I forgot to mention: the compiler chokes on
static assert(!__traits(compiles, xc[0] = 1.0));
with:
found '=' when expecting ')' following template argument list
But
static
Thanks everybody for your help!
On Saturday, January 17, 2015 00:38:08 Luc Bourhis via Digitalmars-d wrote:
Testing constness implementation is easy:
const Foo a;
a.non_const_method(); // compilation fails
but how would I catch that in a unittest?
std.datetime has tests like this for that:
const cdate = Date(1999, 7,
Testing constness implementation is easy:
const Foo a;
a.non_const_method(); // compilation fails
but how would I catch that in a unittest?
On Saturday, 17 January 2015 at 00:38:09 UTC, Luc Bourhis wrote:
Testing constness implementation is easy:
const Foo a;
a.non_const_method(); // compilation fails
but how would I catch that in a unittest?
Something like this?
static assert(!__traits(compiles, a.non_const_method()))
On Sat, 17 Jan 2015 00:38:08 +
Luc Bourhis via Digitalmars-d digitalmars-d@puremagic.com wrote:
Testing constness implementation is easy:
const Foo a;
a.non_const_method(); // compilation fails
but how would I catch that in a unittest?
i don't think that you can do it with one