We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1d6c9e commit 56c0401Copy full SHA for 56c0401
1 file changed
src/lib_json/json_valueiterator.inl
@@ -97,7 +97,18 @@ ValueIteratorBase::computeDistance( const SelfType &other ) const
97
{
98
return 0;
99
}
100
- return difference_type( std::distance( current_, other.current_ ) );
+
101
102
+ // Usage of std::distance is not portable (does not compile with Sun Studio 12 RogueWave STL,
103
+ // which is the one used by default).
104
+ // Using a portable hand-made version for non random iterator instead:
105
+ // return difference_type( std::distance( current_, other.current_ ) );
106
+ difference_type myDistance = 0;
107
+ for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it )
108
+ {
109
+ ++myDistance;
110
+ }
111
+ return myDistance;
112
# endif
113
#else
114
if ( isArray_ )
0 commit comments