PixInsight Forum (historical)
PixInsight => Bug Reports => Topic started by: Nocturnal on 2009 May 14 07:13:25
-
Hi Juan,
array.h doesn't compile when using the __PCL_DIAGNOSTICS_LEVEL=2 preprocessor variable. I've removed the () after end and now it works. Sounds like you don't develop your modules with your own debug code enabled? Tsk tsk task :)
iterator Insert( iterator i, const T& v, size_type n = 1 )
{
PCL_PRECONDITION( i >= data->begin && i <= data->end() ) // this line doesn't compile
if ( n != 0 )
{
if ( !IsUnique() )
{
distance_type p = i - data->begin;
SetUnique();
i = data->begin + p;
}
data->Initialize( i = data->UninitializedGrow( i, n ), n, v );
}
return i;
}
-
:P Yeah, you've catched me! I haven't used PCL diagnostics code for a long time. I always write it, but more as a sort of "internal documentation" than as real debug code. But of course, it should compile correctly, so it seems I've been a bit too lazy with this...
I'll recompile a few particularly complex modules with diagnostics enabled, to check if there are more errors. Thank you for pointing this out.
-
I think asserts are very useful to find errors as soon as possible. I'd rather have an assert bomb than have the debugger tell me something mysterious happened and that no stack is available :)