noExplicitConstructor

This commit is contained in:
gtsoul-tech
2024-05-10 10:07:47 +03:00
parent 692a63c8ca
commit 94b17ecaf2
52 changed files with 245 additions and 204 deletions

View File

@@ -68,7 +68,7 @@ public:
AlignedAllocator() noexcept {}
template <class U, std::size_t N2>
AlignedAllocator(const AlignedAllocator<U, N2> &) noexcept {}
explicit AlignedAllocator(const AlignedAllocator<U, N2> &) noexcept {}
template <class U> struct rebind {
using other = AlignedAllocator<U, N>;

View File

@@ -64,7 +64,7 @@ public:
assert(none());
}
bitfield(const boost::dynamic_bitset<> &a) : bits{{0}} {
explicit bitfield(const boost::dynamic_bitset<> &a) : bits{{0}} {
assert(a.size() == requested_size);
assert(none());
for (auto i = a.find_first(); i != a.npos; i = a.find_next(i)) {

View File

@@ -66,7 +66,7 @@ public:
}
}
bytecode_ptr(std::nullptr_t) {}
explicit bytecode_ptr(std::nullptr_t) {}
T *get() const { return ptr.get(); }

View File

@@ -195,10 +195,10 @@ public:
// Constructors.
flat_set(const Compare &compare = Compare(),
explicit flat_set(const Compare &compare = Compare(),
const Allocator &alloc = Allocator())
: base_type(compare, alloc) {}
template <class InputIt>
flat_set(InputIt first, InputIt last, const Compare &compare = Compare(),
const Allocator &alloc = Allocator())
@@ -425,7 +425,7 @@ public:
// Constructors.
flat_map(const Compare &compare = Compare(),
explicit flat_map(const Compare &compare = Compare(),
const Allocator &alloc = Allocator())
: base_type(compare, alloc) {}
@@ -615,7 +615,7 @@ public:
friend class flat_map;
protected:
Compare c;
value_compare(Compare c_in) : c(c_in) {}
explicit value_compare(Compare c_in) : c(c_in) {}
public:
bool operator()(const value_type &lhs, const value_type &rhs) {
return c(lhs.first, rhs.first);

View File

@@ -56,7 +56,7 @@ struct hash_output_it {
using reference = void;
using iterator_category = std::output_iterator_tag;
hash_output_it(size_t *hash_out = nullptr) : out(hash_out) {}
explicit hash_output_it(size_t *hash_out = nullptr) : out(hash_out) {}
hash_output_it &operator++() {
return *this;
}
@@ -65,7 +65,7 @@ struct hash_output_it {
}
struct deref_proxy {
deref_proxy(size_t *hash_out) : out(hash_out) {}
explicit deref_proxy(size_t *hash_out) : out(hash_out) {}
template<typename T>
void operator=(const T &val) const {
@@ -76,7 +76,7 @@ struct hash_output_it {
size_t *out; /* output location of the owning iterator */
};
deref_proxy operator*() { return {out}; }
deref_proxy operator*() { return deref_proxy(out); }
private:
size_t *out; /* location to output the hashes to */

View File

@@ -210,7 +210,7 @@ public:
* edge() and add_edge(). As we have null_edges and we always allow
* parallel edges, the bool component of the return from these functions is
* not required. */
edge_descriptor(const std::pair<edge_descriptor, bool> &tup)
explicit edge_descriptor(const std::pair<edge_descriptor, bool> &tup)
: p(tup.first.p), serial(tup.first.serial) {
assert(tup.second == (bool)tup.first);
}
@@ -432,7 +432,7 @@ public:
vertex_descriptor> {
using super = typename adjacency_iterator::iterator_adaptor_;
public:
adjacency_iterator(out_edge_iterator a) : super(std::move(a)) { }
explicit adjacency_iterator(out_edge_iterator a) : super(std::move(a)) { }
adjacency_iterator() { }
vertex_descriptor dereference() const {
@@ -448,7 +448,7 @@ public:
vertex_descriptor> {
using super = typename inv_adjacency_iterator::iterator_adaptor_;
public:
inv_adjacency_iterator(in_edge_iterator a) : super(std::move(a)) { }
explicit inv_adjacency_iterator(in_edge_iterator a) : super(std::move(a)) { }
inv_adjacency_iterator() { }
vertex_descriptor dereference() const {
@@ -791,7 +791,7 @@ public:
typedef typename boost::lvalue_property_map_tag category;
prop_map(value_type P_of::*m_in) : member(m_in) { }
explicit prop_map(value_type P_of::*m_in) : member(m_in) { }
reference operator[](key_type k) const {
return k.raw()->props.*member;