Fix using directive refers to implicitly-defined namespace 'std'.

This commit is contained in:
Tetsuo Kiso 2012-05-06 05:27:04 +09:00
parent 4b5fe180ed
commit df4586740d
2 changed files with 8 additions and 8 deletions

View File

@ -17,6 +17,8 @@
#include "Util.h" #include "Util.h"
#include "util/check.hh" #include "util/check.hh"
using namespace std;
Data::Data() Data::Data()
: m_scorer(NULL), : m_scorer(NULL),
m_num_scores(0), m_num_scores(0),

View File

@ -9,8 +9,6 @@
#ifndef MERT_DATA_H_ #ifndef MERT_DATA_H_
#define MERT_DATA_H_ #define MERT_DATA_H_
using namespace std;
#include <vector> #include <vector>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
@ -30,7 +28,7 @@ class Data
private: private:
Scorer* m_scorer; Scorer* m_scorer;
std::string m_score_type; std::string m_score_type;
size_t m_num_scores; std::size_t m_num_scores;
bool m_sparse_flag; bool m_sparse_flag;
ScoreDataHandle m_score_data; ScoreDataHandle m_score_data;
FeatureDataHandle m_feature_data; FeatureDataHandle m_feature_data;
@ -50,11 +48,11 @@ public:
Scorer* getScorer() { return m_scorer; } Scorer* getScorer() { return m_scorer; }
size_t NumberOfFeatures() const { std::size_t NumberOfFeatures() const {
return m_feature_data->NumberOfFeatures(); return m_feature_data->NumberOfFeatures();
} }
void NumberOfFeatures(size_t v) { m_feature_data->NumberOfFeatures(v); } void NumberOfFeatures(std::size_t v) { m_feature_data->NumberOfFeatures(v); }
std::string Features() const { return m_feature_data->Features(); } std::string Features() const { return m_feature_data->Features(); }
void Features(const std::string &f) { m_feature_data->Features(f); } void Features(const std::string &f) { m_feature_data->Features(f); }
@ -76,11 +74,11 @@ public:
return m_feature_data->existsFeatureNames(); return m_feature_data->existsFeatureNames();
} }
inline std::string getFeatureName(size_t idx) const { inline std::string getFeatureName(std::size_t idx) const {
return m_feature_data->getFeatureName(idx); return m_feature_data->getFeatureName(idx);
} }
inline size_t getFeatureIndex(const std::string& name) const { inline std::size_t getFeatureIndex(const std::string& name) const {
return m_feature_data->getFeatureIndex(name); return m_feature_data->getFeatureIndex(name);
} }
@ -90,7 +88,7 @@ public:
* the data (with replacement) and shard_size is interpreted as the proportion * the data (with replacement) and shard_size is interpreted as the proportion
* of the total size. * of the total size.
*/ */
void createShards(size_t shard_count, float shard_size, const std::string& scorerconfig, void createShards(std::size_t shard_count, float shard_size, const std::string& scorerconfig,
std::vector<Data>& shards); std::vector<Data>& shards);
// Helper functions for loadnbest(); // Helper functions for loadnbest();