We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following piece of code fails to compile:
#include <vector> #include <array> #include <dbg.h> int main() { std::array<unsigned int, 256> x{}; dbg(x); }
The problem boils down to
dbg.h: In substitution of ‘template<class T> using detect_size_t = decltype (dbg_macro::detail::{anonymous}::size(declval<T>())) [with T = std::array<unsigned int, 256>]’: test.cc:12:39: required from here dbg.h:205:36: error: call of overloaded ‘size(std::array<unsigned int, 256>)’ is ambiguous 205 | using detect_size_t = decltype(size(std::declval<T>())); | ~~~~^~~~~~~~~~~~~~~~~~~ dbg.h:189:16: note: candidate: ‘constexpr decltype (c.size()) dbg_macro::detail::{anonymous}::size(const T&) [with T = std::array<unsigned int, 256>; decltype (c.size()) = long unsigned int]’ 189 | constexpr auto size(const T& c) -> decltype(c.size()) { | ^~~~ In file included from /usr/include/c++/9/string:54, from /usr/include/c++/9/stdexcept:39, from /usr/include/c++/9/array:39, from test.cc:1: /usr/include/c++/9/bits/range_access.h:242:5: note: candidate: ‘constexpr decltype (__cont.size()) std::size(const _Container&) [with _Container = std::array<unsigned int, 256>; decltype (__cont.size()) = long unsigned int]’ 242 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~
Changing line 204 from:
template <typename T> using detect_size_t = decltype(size(std::declval<T>()));
to
template <typename T> using detect_size_t = decltype(std::declval<T>().size());
solves the problem for me
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The following piece of code fails to compile:
The problem boils down to
Changing line 204 from:
to
solves the problem for me
The text was updated successfully, but these errors were encountered: