Author Topic: array.h doesn't compile with __PCL_DIAGNOSTICS_LEVEL defined  (Read 3133 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
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 :)

Code: [Select]
  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;
   }
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
 :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.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
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 :)
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity