You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2008/06/24 22:23:36 UTC

Re: svn commit: r662845 - in /stdcxx/branches/4.2.x: examples/include/ examples/tutorial/ tests/iostream/ tests/localization/ tests/regress/ tests/utilities/

elemings@apache.org wrote:
> Author: elemings
> Date: Tue Jun  3 10:24:08 2008
> New Revision: 662845
> 
> URL: http://svn.apache.org/viewvc?rev=662845&view=rev
> Log:
> 2008-06-03  Eric Lemings <er...@roguewave.com>
> 
> 	STDCXX-550
[...]
> 	* tests/utilities/20.operators.cpp (RandomNumberGenerator):
> 	Change parameter type of RNG from hard-coded `int' to template
> 	parameter `T'.
> 	(test_random_access_iterators): Instantiate RNG using difference
> 	type of iterator rather than value type as specified by
> 	`random_shuffle' requirements.
[...]

I suspect this change is causing the test to fail to compile
with HP aCC 3.63 (I haven't checked more recent versions or
other compilers).

Brad, can you please take a look at it?

Thanks
Martin

> Modified: stdcxx/branches/4.2.x/tests/utilities/20.operators.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/utilities/20.operators.cpp?rev=662845&r1=662844&r2=662845&view=diff
> ==============================================================================
> --- stdcxx/branches/4.2.x/tests/utilities/20.operators.cpp (original)
> +++ stdcxx/branches/4.2.x/tests/utilities/20.operators.cpp Tue Jun  3 10:24:08 2008
> @@ -169,7 +169,7 @@
>  template <class T>
>  struct RandomNumberGenerator
>  {
> -    T operator() (int) const {
> +    T operator() (T) const {
>          return T ();
>      }
>  };
> @@ -397,7 +397,7 @@
>  
>      typedef RandomAccessIterator I;
>  
> -    RandomNumberGenerator<T> rndgen;
> +    RandomNumberGenerator<typename I::difference_type> rndgen;
>  
>      std::random_shuffle (I (), I ());
>      std::random_shuffle (I (), I (), rndgen);
> 
> 


RE: svn commit: r662845 - in /stdcxx/branches/4.2.x: examples/include/ examples/tutorial/ tests/iostream/ tests/localization/ tests/regress/ tests/utilities/

Posted by Eric Lemings <Er...@roguewave.com>.
 

> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Tuesday, June 24, 2008 2:24 PM
> To: dev@stdcxx.apache.org
> Subject: Re: svn commit: r662845 - in /stdcxx/branches/4.2.x: 
> examples/include/ examples/tutorial/ tests/iostream/ 
> tests/localization/ tests/regress/ tests/utilities/
> 
> elemings@apache.org wrote:
> > Author: elemings
> > Date: Tue Jun  3 10:24:08 2008
> > New Revision: 662845
> > 
> > URL: http://svn.apache.org/viewvc?rev=662845&view=rev
> > Log:
> > 2008-06-03  Eric Lemings <er...@roguewave.com>
> > 
> > 	STDCXX-550
> [...]
> > 	* tests/utilities/20.operators.cpp (RandomNumberGenerator):
> > 	Change parameter type of RNG from hard-coded `int' to template
> > 	parameter `T'.
> > 	(test_random_access_iterators): Instantiate RNG using difference
> > 	type of iterator rather than value type as specified by
> > 	`random_shuffle' requirements.
> [...]
> 
> I suspect this change is causing the test to fail to compile
> with HP aCC 3.63 (I haven't checked more recent versions or
> other compilers).
> 
> Brad, can you please take a look at it?

Yeah it looks like I'll need to add conditional compilation to take
debug iterators into account.  I'm assuming that's how the compiler is
deducing type `int*' from types `std::deque<int>::iterator,
std::basic_string<T>::iterator, and std::vector<T>::iterator`.

Brad.