]> Creatis software - gdcm.git/blobdiff - src/gdcmSegmentedPalette.h
Fix mistypings
[gdcm.git] / src / gdcmSegmentedPalette.h
index 3c9c13877be6ab2e0e417e2bff84148ab350355c..1a53fa745138d9a1fed40664b61a0f49f156a7b0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSegmentedPalette.h,v $
   Language:  C++
-  Date:      $Date: 2007/10/30 09:14:42 $
-  Version:   $Revision: 1.15 $
+  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
@@ -55,7 +55,7 @@
 #endif
 
 // Hack for Borland
-#if defined(__BORLANDC__)
+#if (defined(_MSC_VER) && (_MSC_VER < 1310)) || defined(__BORLANDC__)
 #define GDCM_TYPENAME2
 #else
 #define GDCM_TYPENAME2 typename
 
 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<typename InputIterator>
     inline int32_t
     mydistance(InputIterator first, InputIterator last)
@@ -86,7 +91,7 @@ namespace GDCM_NAME_SPACE
     template <typename EntryType>
     class Segment {
     public:
-        typedef std::map<const EntryType*, const Segment*> SegmentMap;
+        typedef std::map<const EntryType* const, const Segment*> SegmentMap;
         virtual bool Expand(const SegmentMap& instances,
             std::vector<EntryType>& expanded) const = 0;
         const EntryType* First() const { return _first; }
@@ -108,7 +113,9 @@ namespace GDCM_NAME_SPACE
     template <typename EntryType>
     class DiscreteSegment : public Segment<EntryType> {
     public:
+#if !defined(__sun__)
         typedef typename Segment<EntryType>::SegmentMap SegmentMap;
+#endif
         DiscreteSegment(const EntryType* first)
             : Segment<EntryType>(first, first+2+*(first+1)) {}
         virtual bool Expand(const SegmentMap&,
@@ -123,7 +130,9 @@ namespace GDCM_NAME_SPACE
     template <typename EntryType>
     class LinearSegment : public Segment<EntryType> {
     public:
+#if !defined(__sun__)
         typedef typename Segment<EntryType>::SegmentMap SegmentMap;
+#endif
         LinearSegment(const EntryType* first)
             : Segment<EntryType>(first, first+3) {}
         virtual bool Expand(const SegmentMap&,
@@ -152,7 +161,9 @@ namespace GDCM_NAME_SPACE
     template <typename EntryType>
     class IndirectSegment : public Segment<EntryType> {
     public:
+#if !defined(__sun__)
         typedef typename Segment<EntryType>::SegmentMap SegmentMap;
+#endif
         IndirectSegment(const EntryType* first)
             : Segment<EntryType>(first, first+2+4/sizeof(EntryType)) {}
         virtual bool Expand(const SegmentMap& instances,