comparison src/DLD-FUNCTIONS/rand.cc @ 13739:0206484682c6

rand.cc: Don't bring the whole std namespace into scope, only unordered_map
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Thu, 20 Oct 2011 14:28:13 -0500
parents 478efc95cb7a
children b0cdd60db5e5
comparison
equal deleted inserted replaced
13738:7ee61e56eaed 13739:0206484682c6
43 #include "gripes.h" 43 #include "gripes.h"
44 #include "oct-obj.h" 44 #include "oct-obj.h"
45 #include "unwind-prot.h" 45 #include "unwind-prot.h"
46 #include "utils.h" 46 #include "utils.h"
47 #include "ov-re-mat.h" 47 #include "ov-re-mat.h"
48
49 #ifdef USE_UNORDERED_MAP_WITH_TR1
50 using namespace std::tr1;
51 #else
52 using namespace std;
53 #endif
54 48
55 /* 49 /*
56 %!shared __random_statistical_tests__ 50 %!shared __random_statistical_tests__
57 %! % Flag whether the statistical tests should be run in "make check" or not 51 %! % Flag whether the statistical tests should be run in "make check" or not
58 %! __random_statistical_tests__ = 0; 52 %! __random_statistical_tests__ = 0;
1035 O(@var{m}) memory is used as well. The randomization is performed using\n\ 1029 O(@var{m}) memory is used as well. The randomization is performed using\n\
1036 rand(). All permutations are equally likely.\n\ 1030 rand(). All permutations are equally likely.\n\
1037 @seealso{perms}\n\ 1031 @seealso{perms}\n\
1038 @end deftypefn") 1032 @end deftypefn")
1039 { 1033 {
1034
1035 #ifdef USE_UNORDERED_MAP_WITH_TR1
1036 using std::tr1::unordered_map;
1037 #else
1038 using std::unordered_map;
1039 #endif
1040
1040 int nargin = args.length (); 1041 int nargin = args.length ();
1041 octave_value retval; 1042 octave_value retval;
1042 1043
1043 if (nargin == 1 || nargin == 2) 1044 if (nargin == 1 || nargin == 2)
1044 { 1045 {