diff options
author | David Shah <dave@ds0.me> | 2021-02-05 11:32:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-05 11:32:09 +0000 |
commit | b0f9b7834e4cb035d1fd60f0fa1948c0fdfa233c (patch) | |
tree | d8b70c19580030a1ee28431b5d2287a0ae1690da /common/nextpnr.h | |
parent | 40d026e6fc5ab94c732682c62a6803bd3140953e (diff) | |
parent | 450bfae86cc807e4aec8d3b725169fd044212079 (diff) | |
download | nextpnr-b0f9b7834e4cb035d1fd60f0fa1948c0fdfa233c.tar.gz nextpnr-b0f9b7834e4cb035d1fd60f0fa1948c0fdfa233c.tar.bz2 nextpnr-b0f9b7834e4cb035d1fd60f0fa1948c0fdfa233c.zip |
Merge pull request #570 from litghost/make_id_string_list_explicit
Mark IdString and IdStringList single argument constructors explicit.
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r-- | common/nextpnr.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h index 78bbf66e..2445bed1 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -110,7 +110,8 @@ struct IdString static void initialize_add(const BaseCtx *ctx, const char *s, int idx); - constexpr IdString(int index = 0) : index(index) {} + constexpr IdString() : index(0) {} + explicit constexpr IdString(int index) : index(index) {} void set(const BaseCtx *ctx, const std::string &s); @@ -229,9 +230,9 @@ struct IdStringList SSOArray<IdString, 4> ids; IdStringList(){}; - IdStringList(size_t n) : ids(n, IdString()){}; - IdStringList(IdString id) : ids(1, id){}; - template <typename Tlist> IdStringList(const Tlist &list) : ids(list){}; + explicit IdStringList(size_t n) : ids(n, IdString()){}; + explicit IdStringList(IdString id) : ids(1, id){}; + template <typename Tlist> explicit IdStringList(const Tlist &list) : ids(list){}; static IdStringList parse(Context *ctx, const std::string &str); void build_str(const Context *ctx, std::string &str) const; |