X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSegmentedPalette.h;h=1a53fa745138d9a1fed40664b61a0f49f156a7b0;hb=56ad78cdf3b5de32f0a94a38cd32ddc9f403ffc3;hp=ca33a964da80d3a68f91d329a2bea21d916a9a97;hpb=b0547f7c8211140657f26a3679da66c67dc0bdbd;p=gdcm.git diff --git a/src/gdcmSegmentedPalette.h b/src/gdcmSegmentedPalette.h index ca33a964..1a53fa74 100644 --- a/src/gdcmSegmentedPalette.h +++ b/src/gdcmSegmentedPalette.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSegmentedPalette.h,v $ Language: C++ - Date: $Date: 2007/10/30 13:35:08 $ - Version: $Revision: 1.17 $ + Date: $Date: 2007/11/13 09:37:22 $ + Version: $Revision: 1.20 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -64,11 +64,16 @@ namespace GDCM_NAME_SPACE { -// Long stody short: Sun compiler only provide the second interface of std::distance, since the implemenation -// is so trivial, I'd rather redo it myself. +// Long stody short: Sun compiler only provide the second interface of +// std::distance, since the implementation is so trivial, I'd rather redo it myself. // Ref: // http://www.sgi.com/tech/stl/distance.html#2 -// The second version of distance was the one defined in the original STL, and the first version is the one defined in the draft C++ standard; the definition was changed because the older interface was clumsy and error-prone. The older interface required the use of a temporary variable, and it has semantics that are somewhat nonintuitive: it increments n by the distance from first to last, rather than storing that distance in n +// The second version of distance was the one defined in the original STL, and +// the first version is the one defined in the draft C++ standard; the definition +// was changed because the older interface was clumsy and error-prone. +// The older interface required the use of a temporary variable, and it has semantics +// that are somewhat nonintuitive: it increments n by the distance from first to last, +// rather than storing that distance in n template inline int32_t mydistance(InputIterator first, InputIterator last) @@ -108,7 +113,9 @@ namespace GDCM_NAME_SPACE template class DiscreteSegment : public Segment { public: +#if !defined(__sun__) typedef typename Segment::SegmentMap SegmentMap; +#endif DiscreteSegment(const EntryType* first) : Segment(first, first+2+*(first+1)) {} virtual bool Expand(const SegmentMap&, @@ -123,7 +130,9 @@ namespace GDCM_NAME_SPACE template class LinearSegment : public Segment { public: +#if !defined(__sun__) typedef typename Segment::SegmentMap SegmentMap; +#endif LinearSegment(const EntryType* first) : Segment(first, first+3) {} virtual bool Expand(const SegmentMap&, @@ -152,7 +161,9 @@ namespace GDCM_NAME_SPACE template class IndirectSegment : public Segment { public: +#if !defined(__sun__) typedef typename Segment::SegmentMap SegmentMap; +#endif IndirectSegment(const EntryType* first) : Segment(first, first+2+4/sizeof(EntryType)) {} virtual bool Expand(const SegmentMap& instances,