~zorba-coders/zorba/bug-1189790

« back to all changes in this revision

Viewing changes to src/zorbatypes/integer.h

  • Committer: Paul J. Lucas
  • Date: 2013-06-25 16:54:34 UTC
  • mfrom: (11502.1.37 zorba)
  • Revision ID: paul@lucasmail.org-20130625165434-b1dvqff1e7o87x5l
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
  explicit IntegerImpl( char const *s );
176
176
 
177
177
  /**
 
178
   * Constructs an %IntegerImpl from a string.
 
179
   *
 
180
   * @tparam StringType The string type.
 
181
   * @param s The string to parse.  Leading and trailing whitespace is ignored.
 
182
   * @throw std::invalid_argument if \a s does not contain a valid integer.
 
183
   * @throw std::range_error if \a s contains an integer that either underflows
 
184
   * or overflows the smallest or largest representable/legal integer.
 
185
   */
 
186
  template<class StringType>
 
187
  explicit IntegerImpl( StringType const &s,
 
188
    typename std::enable_if<ZORBA_HAS_C_STR(StringType)>::type* = nullptr );
 
189
 
 
190
  /**
178
191
   * Constructs an %IntegerImpl from a Double.
179
192
   *
180
193
   * @param d The Double.
232
245
  IntegerImpl& operator=( double n );
233
246
 
234
247
  IntegerImpl& operator=( char const *s );
 
248
 
 
249
  template<class StringType>
 
250
  typename std::enable_if<ZORBA_HAS_C_STR(StringType),IntegerImpl&>::type
 
251
  operator=( StringType const &s );
 
252
 
235
253
  IntegerImpl& operator=( Decimal const &d );
236
254
  IntegerImpl& operator=( Double const &d );
237
255
  IntegerImpl& operator=( Float const &f );
721
739
}
722
740
 
723
741
template<class T>
 
742
template<class StringType>
 
743
inline IntegerImpl<T>::IntegerImpl( StringType const &s,
 
744
  typename std::enable_if<ZORBA_HAS_C_STR(StringType)>::type* )
 
745
{
 
746
  parse( s.c_str() );
 
747
}
 
748
 
 
749
template<class T>
724
750
template<class U>
725
751
inline IntegerImpl<T>::IntegerImpl( IntegerImpl<U> const &i ) :
726
752
  value_( T::check_value( i.value_ ) )
760
786
}
761
787
 
762
788
template<class T>
 
789
template<class StringType> inline
 
790
typename std::enable_if<ZORBA_HAS_C_STR(StringType),IntegerImpl<T>&>::type
 
791
IntegerImpl<T>::operator=( StringType const &s ) {
 
792
  return operator=( s.c_str() );
 
793
}
 
794
 
 
795
template<class T>
763
796
template<class U>
764
797
inline IntegerImpl<T>& IntegerImpl<T>::operator=( IntegerImpl<U> const &i ) {
765
798
  T::check_value( value_ = i.value_ );