@@ -30,7 +30,6 @@ namespace dlib
3030 std::vector<label_type, alloc2>& labels
3131 )
3232 {
33- using namespace std ;
3433 typedef typename sample_type::value_type pair_type;
3534 typedef typename basic_type<typename pair_type::first_type>::type key_type;
3635 typedef typename pair_type::second_type value_type;
@@ -41,13 +40,13 @@ namespace dlib
4140 samples.clear ();
4241 labels.clear ();
4342
44- ifstream fin (file_name.c_str ());
43+ std:: ifstream fin (file_name.c_str ());
4544
4645 if (!fin)
4746 throw sample_data_io_error (" Unable to open file " + file_name);
4847
49- string line;
50- istringstream sin;
48+ std:: string line;
49+ std:: istringstream sin;
5150 key_type key;
5251 value_type value;
5352 label_type label;
@@ -56,12 +55,12 @@ namespace dlib
5655 while (fin.peek () != EOF)
5756 {
5857 ++line_num;
59- getline (fin, line);
58+ std:: getline (fin, line);
6059
61- string::size_type pos = line.find_first_not_of (" \t\r\n " );
60+ std:: string::size_type pos = line.find_first_not_of (" \t\r\n " );
6261
6362 // ignore empty lines or comment lines
64- if (pos == string::npos || line[pos] == ' #' )
63+ if (pos == std:: string::npos || line[pos] == ' #' )
6564 continue ;
6665
6766 sin.clear ();
@@ -74,12 +73,12 @@ namespace dlib
7473 throw sample_data_io_error (" On line: " + cast_to_string (line_num) + " , error while reading file " + file_name );
7574
7675 // eat whitespace
77- sin >> ws;
76+ sin >> std:: ws;
7877
7978 while (sin.peek () != EOF && sin.peek () != ' #' )
8079 {
8180
82- sin >> key >> ws;
81+ sin >> key >> std:: ws;
8382
8483 // ignore what should be a : character
8584 if (sin.get () != ' :' )
@@ -89,10 +88,10 @@ namespace dlib
8988
9089 if (sin && value != 0 )
9190 {
92- sample.insert (sample.end (), make_pair (key, value));
91+ sample.insert (sample.end (), std:: make_pair (key, value));
9392 }
9493
95- sin >> ws;
94+ sin >> std:: ws;
9695 }
9796
9897 samples.push_back (sample);
@@ -202,8 +201,7 @@ namespace dlib
202201 );
203202
204203
205- using namespace std ;
206- ofstream fout (file_name.c_str ());
204+ std::ofstream fout (file_name.c_str ());
207205 fout.precision (14 );
208206
209207 if (!fout)
@@ -244,8 +242,7 @@ namespace dlib
244242 << " \n\t labels.size(): " << labels.size ()
245243 );
246244
247- using namespace std ;
248- ofstream fout (file_name.c_str ());
245+ std::ofstream fout (file_name.c_str ());
249246 fout.precision (14 );
250247
251248 if (!fout)
0 commit comments