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
Example:
#include <concepts> #include <vector> #include <fmt/ranges.h> template <bool Copyable> struct Vector { std::vector<int> v; Vector(std::initializer_list<int> elems) : v(elems) { } Vector(Vector&&) = default; Vector& operator=(Vector&&) = default; Vector(Vector const&) requires Copyable = default; Vector& operator=(Vector const&) requires Copyable = default; auto begin() { return v.begin(); } auto end() { return v.end(); } }; static_assert(std::movable<Vector<false>>); static_assert(std::movable<Vector<true>>); static_assert(!std::copyable<Vector<false>>); static_assert(std::copyable<Vector<true>>); int main() { fmt::print("{}\n", Vector<true>{1, 2, 3}); // ok [1, 2, 3] fmt::print("{}\n", Vector<false>{1, 2, 3}); // error }
This is because the range check for non-const ranges requires copyability and should probably just be removed (h/t @timsong-cpp):
fmt/include/fmt/ranges.h
Lines 154 to 159 in a2c05a1
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Example:
This is because the range check for non-const ranges requires copyability and should probably just be removed (h/t @timsong-cpp):
fmt/include/fmt/ranges.h
Lines 154 to 159 in a2c05a1
The text was updated successfully, but these errors were encountered: