]> git.tdb.fi Git - builder.git/blobdiff - source/architecture.h
Use default member initializers and constructor delegation
[builder.git] / source / architecture.h
index 776de858b03fcc2b587771e73f9322ab29f1d815..4642080c59307ab897fabb76d22c81d26ea70aed 100644 (file)
@@ -27,12 +27,12 @@ private:
        std::string cpu;
        std::string fpu;
        std::string system;
-       unsigned bits;
+       unsigned bits = 0;
        std::string toolchain;
        std::string name;
-       bool native;
+       bool native = false;
        std::string cross_prefix;
-       std::map<std::string, std::list<Pattern>> filename_patterns;
+       std::map<std::string, std::vector<Pattern>> filename_patterns;
 
 public:
        Architecture(Builder &b, const std::string &spec);
@@ -52,7 +52,7 @@ public:
        const std::string &get_cross_prefix() const { return cross_prefix; }
 
        template<typename T>
-       const std::list<Pattern> &get_patterns() const;
+       const std::vector<Pattern> &get_patterns() const;
 
        template<typename T>
        std::string create_filename(const std::string &) const;
@@ -67,20 +67,20 @@ private:
 };
 
 template<typename T>
-inline const std::list<Pattern> &Architecture::get_patterns() const
+inline const std::vector<Pattern> &Architecture::get_patterns() const
 {
        auto i = filename_patterns.find(typeid(T).name());
        if(i!=filename_patterns.end())
                return i->second;
 
-       static std::list<Pattern> empty;
+       static std::vector<Pattern> empty;
        return empty;
 }
 
 template<typename T>
 inline std::string Architecture::create_filename(const std::string &base) const
 {
-       const std::list<Pattern> &patterns = get_patterns<T>();
+       const std::vector<Pattern> &patterns = get_patterns<T>();
        return patterns.empty() ? base : patterns.front().apply(base);
 }