[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Potentially "dangerous" changeset, please test
From: |
Michael Goffioul |
Subject: |
Re: Potentially "dangerous" changeset, please test |
Date: |
Thu, 6 Oct 2011 21:56:22 +0100 |
2011/9/30 Michael Goffioul <address@hidden>:
> 2011/9/30 Jordi Gutiérrez Hermoso <address@hidden>:
>> I pushed the following which is suposed to optimise several cases for
>> randperm, which is important now that I've made randperm a central
>> function for the sprand family of functions:
>>
>> http://hg.savannah.gnu.org/hgweb/octave/rev/dd3c5325039c
>>
>> However, this change is potentially "dangerous" because it uses an
>> "experimental" C++ feature (actually, it was experimental eight years
>> ago). If you see build failures on rand.cc related to tr1 or
>> unordered_map please blame me.
>
> Just a suggestion: write a configure tests to check various things, like
> - existence of unordered_map, fallback to std::map
> - location of unordered_map header (<tr1/unordered_map> vs. <unordered_map>
> - namespace required: std::tr1 vs. std
As I suspected, the change above fails to compile under MSVC, because
the header to include is <unordered_map>, not <tr1/unordered_map>.
In C++11, the header to include is also <unordered_map>. So I suggest
you write a configure test to check for the header location and namespace
to use.
Michael.
- Re: Potentially "dangerous" changeset, please test,
Michael Goffioul <=