diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-05-06 00:27:04 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-05-06 00:27:04 +0400 |
commit | df4586740d8319739a196bfc4df2bdeb7862b29a (patch) | |
tree | 471287da16a567fe784039342b23fec0a3f45025 | |
parent | 4b5fe180ed7450d0cffcd6ddbd67f2a0caeed69f (diff) |
Fix using directive refers to implicitly-defined namespace 'std'.
-rw-r--r-- | mert/Data.cpp | 2 | ||||
-rw-r--r-- | mert/Data.h | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/mert/Data.cpp b/mert/Data.cpp index be4c65fb2..19a89f754 100644 --- a/mert/Data.cpp +++ b/mert/Data.cpp @@ -17,6 +17,8 @@ #include "Util.h" #include "util/check.hh" +using namespace std; + Data::Data() : m_scorer(NULL), m_num_scores(0), diff --git a/mert/Data.h b/mert/Data.h index 1b5815f77..37d4b5473 100644 --- a/mert/Data.h +++ b/mert/Data.h @@ -9,8 +9,6 @@ #ifndef MERT_DATA_H_ #define MERT_DATA_H_ -using namespace std; - #include <vector> #include <boost/shared_ptr.hpp> @@ -30,7 +28,7 @@ class Data private: Scorer* m_scorer; std::string m_score_type; - size_t m_num_scores; + std::size_t m_num_scores; bool m_sparse_flag; ScoreDataHandle m_score_data; FeatureDataHandle m_feature_data; @@ -50,11 +48,11 @@ public: Scorer* getScorer() { return m_scorer; } - size_t NumberOfFeatures() const { + std::size_t NumberOfFeatures() const { 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(); } void Features(const std::string &f) { m_feature_data->Features(f); } @@ -76,11 +74,11 @@ public: 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); } - 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); } @@ -90,7 +88,7 @@ public: * the data (with replacement) and shard_size is interpreted as the proportion * 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); // Helper functions for loadnbest(); |