Skip to content

Commit

Permalink
- cxon: explicit operator bool
Browse files Browse the repository at this point in the history
  • Loading branch information
oknenavin committed Jun 28, 2024
1 parent 5d60950 commit 34d6325
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/cxon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace cxon {
struct from_bytes_result {
std::error_condition ec;
It end;
operator bool() const noexcept;
explicit operator bool() const noexcept;
};

}
Expand Down Expand Up @@ -179,7 +179,7 @@ namespace cxon {
struct to_bytes_result {
std::error_condition ec;
It end;
operator bool() const noexcept;
explicit operator bool() const noexcept;
};

}
Expand Down Expand Up @@ -662,7 +662,7 @@ Member name |Type | Description
```
- `operator bool` - check if the context is good (i.e. no error condition)
``` c++
operator bool() const noexcept;
explicit operator bool() const noexcept;
```

napa_type (`px`'s type) is a tagged tuple with parameter types as tags.
Expand Down
6 changes: 3 additions & 3 deletions src/cxon/cxon.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace cxon { // interface
struct from_bytes_result {
std::error_condition ec;
It end;
operator bool() const noexcept { return !ec; }
explicit operator bool() const noexcept { return !ec; }
};

template <typename X = CXON_DEFAULT_FORMAT, typename T, typename InIt, typename ...NaPa>
Expand All @@ -56,7 +56,7 @@ namespace cxon { // interface
struct to_bytes_result {
std::error_condition ec;
It end;
operator bool() const noexcept { return !ec; }
explicit operator bool() const noexcept { return !ec; }
};

template <typename X = CXON_DEFAULT_FORMAT, typename T, typename OutIt, typename ...NaPa>
Expand Down Expand Up @@ -91,7 +91,7 @@ namespace cxon { // context
auto operator /(E e) noexcept -> enable_if_t<std::is_error_condition_enum<E>::value, bool> {
return ec = e, !ec;
}
operator bool() const noexcept { return !ec; }
explicit operator bool() const noexcept { return !ec; }
};

template <typename X, typename ...P>
Expand Down
2 changes: 1 addition & 1 deletion src/cxon/lib/node.cbor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ namespace cxon {

}

#endif
#endif // CXON_JSON_DEFINED

#undef CXON_NODE_RG

Expand Down
2 changes: 1 addition & 1 deletion src/cxon/lib/node.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace cxon { namespace node { namespace imp {
template <typename Cx>
struct scinc_<Cx, false> {
scinc_(Cx&) noexcept {}
~scinc_() noexcept {}
~scinc_() noexcept {}
bool check() const noexcept { return true; }
};

Expand Down
2 changes: 1 addition & 1 deletion src/cxon/lib/node.json.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ namespace cxon {

}

#endif
#endif // CXON_CBOR_DEFINED

#undef CXON_NODE_RG

Expand Down

0 comments on commit 34d6325

Please sign in to comment.