random_sample: where did it go?
Jonathan Lennox
lennox@cs.columbia.edu
Tue Aug 20 09:50:00 GMT 2002
Igor Markov writes:
> Another one: power()
> Ok, I can guess, it's in <ext/numeric> :)
> but this makes things harder to figure out
> and also requires lots of #if(GCC_VERSION)
> Is there some way to avoid obfuscating source code
> with detailed gcc version checks?
You can use autoconf to search for the symbols, rather than checking for gcc
versions directly, if you're using autoconf 2.5x. (Autoconf's checking for
type definitions in 2.1x is poor enough that you want to use the later
version.)
Checking for template types is somewhat tricky, because the comma in the
type name interferes with the syntax of m4, so you have to over-quote. (I
think this is an autoconf bug, which I've reported.) I've attached a
configure.ac file which works for me for detecting libstdc++'s hash_map
template class; tested with gcc 2.95.2, 3.0.2, and 3.1.
More information about the Gcc
mailing list