Skip to content
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

compatibility with prettyprint #871

Closed
nevion opened this issue Sep 19, 2018 · 1 comment
Closed

compatibility with prettyprint #871

nevion opened this issue Sep 19, 2018 · 1 comment

Comments

@nevion
Copy link

nevion commented Sep 19, 2018

fmt used to work/integrate well with https://github.com/louisdx/cxx-prettyprint , however I do not find that to be the case since 5.0, outputting something like a std::list of data no longer works.

Reproducing program:

#include <list>

#include <fmt/format.h>
#include <prettyprint.hpp>

int main( int argc, char **argv ) {

  std::list<int> container;

  for( size_t i = 0; i < 10; ++i){
    container.push_back( (int) i );
  }
  fmt::print("container = {}", container);

  return 0;
}

Errors compiling with gcc 5.4:

In file included from external/fmt/include/fmt/format.h:54:0,
from fmttest/main.cpp:4:
external/fmt/include/fmt/core.h: In instantiation of 'static void fmt::v5::internal::value::format_custom_arg(const void*, Context&) [with T = std::__cxx11::list; Context = fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer >, char>]':
external/fmt/include/fmt/core.h:563:19: required from 'fmt::v5::internal::value::value(const T&) [with T = std::__cxx11::list; Context = fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer >, char>]'
external/fmt/include/fmt/core.h:591:76: required from 'fmt::v5::internal::init<Context, T, TYPE>::operator fmt::v5::internal::value() const [with Context = fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer >, char>; T = const std::__cxx11::list&; fmt::v5::internal::type TYPE = (fmt::v5::internal::type)13u]'
external/fmt/include/fmt/core.h:995:35: required from 'typename std::enable_if<IS_PACKED, fmt::v5::internal::value >::type fmt::v5::internal::make_arg(const T&) [with bool IS_PACKED = true; Context = fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer >, char>; T = std::__cxx11::list; typename std::enable_if<IS_PACKED, fmt::v5::internal::value >::type = fmt::v5::internal::value<fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer >, char> >]'
external/fmt/include/fmt/core.h:1053:51: required from 'fmt::v5::format_arg_store<Context, Args>::format_arg_store(const Args& ...) [with Context = fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer >, char>; Args = {std::__cxx11::list<int, std::allocator >}]'
external/fmt/include/fmt/core.h:1431:55: required from 'void fmt::v5::print(fmt::v5::string_view, const Args& ...) [with Args = {std::__cxx11::list<int, std::allocator >}; fmt::v5::string_view = fmt::v5::basic_string_view]'
fmttest/main.cpp:14:41: required from here
external/fmt/include/fmt/core.h:577:56: error: 'fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer >, char>::formatter_type<std::__cxx11::list >::type f' has incomplete type
typename Context::template formatter_type::type f;

@foonathan
Copy link
Contributor

You need to include <fmt/ostream.h>.

@nevion nevion changed the title compatability with prettyprint compatibility with prettyprint Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants