-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
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
fmt::join fails for streamable objects after 6.0.0 #1462
Comments
The old behavior was accidental. To make a type work with |
tchaikov
added a commit
to tchaikov/ceph
that referenced
this issue
Jul 25, 2022
* add formatter for classes with stream insertion operator. as in fmtlib v6.1.2, which is the one shipped with ubuntu focal, fmt::join() requires the printed element to have formatter. see fmtlib/fmt#2040 and fmtlib/fmt#1462 * use template parameter pack to represent container template argument, simpler this way. also, this enables us to print specialized classes which uses non-default template parameters. * use fmt::join() to print container elements. see also https://fmt.dev/latest/api.html#_CPPv4I0EN3fmt4joinE9join_viewIN6detail10iterator_tI5RangeEEN6detail10sentinel_tI5RangeEEERR5Range11string_view Signed-off-by: Kefu Chai <[email protected]>
tchaikov
added a commit
to tchaikov/ceph
that referenced
this issue
Jul 25, 2022
* add formatter for classes with stream insertion operator. as in fmtlib v6.1.2, which is the one shipped with ubuntu focal, fmt::join() requires the printed element to have formatter. see fmtlib/fmt#2040 and fmtlib/fmt#1462 * use template parameter pack to represent container template argument, simpler this way. also, this enables us to print specialized classes which uses non-default template parameters. * use fmt::join() to print container elements. see also https://fmt.dev/latest/api.html#_CPPv4I0EN3fmt4joinE9join_viewIN6detail10iterator_tI5RangeEEN6detail10sentinel_tI5RangeEEERR5Range11string_view Signed-off-by: Kefu Chai <[email protected]>
tchaikov
added a commit
to tchaikov/ceph
that referenced
this issue
Jul 25, 2022
* add formatter for classes with stream insertion operator. as in fmtlib v6.1.2, which is the one shipped with ubuntu focal, fmt::join() requires the printed element to have formatter. see fmtlib/fmt#2040 and fmtlib/fmt#1462 * use template parameter pack to represent container template argument, simpler this way. also, this enables us to print specialized classes which uses non-default template parameters. * use fmt::join() to print container elements. see also https://fmt.dev/latest/api.html#_CPPv4I0EN3fmt4joinE9join_viewIN6detail10iterator_tI5RangeEEN6detail10sentinel_tI5RangeEEERR5Range11string_view Signed-off-by: Kefu Chai <[email protected]>
dparmar18
pushed a commit
to ceph/ceph-ci
that referenced
this issue
Jul 27, 2022
* add formatter for classes with stream insertion operator. as in fmtlib v6.1.2, which is the one shipped with ubuntu focal, fmt::join() requires the printed element to have formatter. see fmtlib/fmt#2040 and fmtlib/fmt#1462 * use template parameter pack to represent container template argument, simpler this way. also, this enables us to print specialized classes which uses non-default template parameters. * use fmt::join() to print container elements. see also https://fmt.dev/latest/api.html#_CPPv4I0EN3fmt4joinE9join_viewIN6detail10iterator_tI5RangeEEN6detail10sentinel_tI5RangeEEERR5Range11string_view Signed-off-by: Kefu Chai <[email protected]>
dparmar18
pushed a commit
to ceph/ceph-ci
that referenced
this issue
Jul 28, 2022
* add formatter for classes with stream insertion operator. as in fmtlib v6.1.2, which is the one shipped with ubuntu focal, fmt::join() requires the printed element to have formatter. see fmtlib/fmt#2040 and fmtlib/fmt#1462 * use template parameter pack to represent container template argument, simpler this way. also, this enables us to print specialized classes which uses non-default template parameters. * use fmt::join() to print container elements. see also https://fmt.dev/latest/api.html#_CPPv4I0EN3fmt4joinE9join_viewIN6detail10iterator_tI5RangeEEN6detail10sentinel_tI5RangeEEERR5Range11string_view Signed-off-by: Kefu Chai <[email protected]>
nizamial09
pushed a commit
to ceph/ceph-ci
that referenced
this issue
Aug 1, 2022
* add formatter for classes with stream insertion operator. as in fmtlib v6.1.2, which is the one shipped with ubuntu focal, fmt::join() requires the printed element to have formatter. see fmtlib/fmt#2040 and fmtlib/fmt#1462 * use template parameter pack to represent container template argument, simpler this way. also, this enables us to print specialized classes which uses non-default template parameters. * use fmt::join() to print container elements. see also https://fmt.dev/latest/api.html#_CPPv4I0EN3fmt4joinE9join_viewIN6detail10iterator_tI5RangeEEN6detail10sentinel_tI5RangeEEERR5Range11string_view Signed-off-by: Kefu Chai <[email protected]>
nizamial09
pushed a commit
to ceph/ceph-ci
that referenced
this issue
Aug 2, 2022
* add formatter for classes with stream insertion operator. as in fmtlib v6.1.2, which is the one shipped with ubuntu focal, fmt::join() requires the printed element to have formatter. see fmtlib/fmt#2040 and fmtlib/fmt#1462 * use template parameter pack to represent container template argument, simpler this way. also, this enables us to print specialized classes which uses non-default template parameters. * use fmt::join() to print container elements. see also https://fmt.dev/latest/api.html#_CPPv4I0EN3fmt4joinE9join_viewIN6detail10iterator_tI5RangeEEN6detail10sentinel_tI5RangeEEERR5Range11string_view Signed-off-by: Kefu Chai <[email protected]>
bosc0
pushed a commit
to bosc0/ceph
that referenced
this issue
Aug 16, 2022
* add formatter for classes with stream insertion operator. as in fmtlib v6.1.2, which is the one shipped with ubuntu focal, fmt::join() requires the printed element to have formatter. see fmtlib/fmt#2040 and fmtlib/fmt#1462 * use template parameter pack to represent container template argument, simpler this way. also, this enables us to print specialized classes which uses non-default template parameters. * use fmt::join() to print container elements. see also https://fmt.dev/latest/api.html#_CPPv4I0EN3fmt4joinE9join_viewIN6detail10iterator_tI5RangeEEN6detail10sentinel_tI5RangeEEERR5Range11string_view Signed-off-by: Kefu Chai <[email protected]>
Pegonzal
pushed a commit
to ceph/ceph
that referenced
this issue
Oct 13, 2022
* add formatter for classes with stream insertion operator. as in fmtlib v6.1.2, which is the one shipped with ubuntu focal, fmt::join() requires the printed element to have formatter. see fmtlib/fmt#2040 and fmtlib/fmt#1462 * use template parameter pack to represent container template argument, simpler this way. also, this enables us to print specialized classes which uses non-default template parameters. * use fmt::join() to print container elements. see also https://fmt.dev/latest/api.html#_CPPv4I0EN3fmt4joinE9join_viewIN6detail10iterator_tI5RangeEEN6detail10sentinel_tI5RangeEEERR5Range11string_view Signed-off-by: Kefu Chai <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For a type which only has a stream operator, i.e.
std::ostream& operator<<(std::ostream&, MyType);
, attempting to print it as elements of a range passed tofmt::join
fails after 6.0.0:In 5.3.0, this compiles and calls the
operator<<
to printMyType
. After 6.0.0, this fails to compile.MCVE. Works for 5.3.0. Fails for 6.0.0.
Seemingly relevant parts of the compile error message:
The text was updated successfully, but these errors were encountered: