Giter VIP home page Giter VIP logo

Comments (5)

danakj avatar danakj commented on May 27, 2024

Adding support for fmtlib here: #244

There is so much to re-implement for display and fmt is high quality and widely used. I think it's the right path, so adding support for formatting of each type.

I need to look further into:

  • display vs debug printing
  • printing types without a formatter as a string of bytes
  • so that Option<unknown> can print Some(...bytes...)
  • add a PrintTo() for anything that is fmtlib formattable.
  • maybe provide a stream impl for anything fmtlib formattable as well in a separate compat header.

from subspace.

danakj avatar danakj commented on May 27, 2024

There is no debug vs display differentiation in fmtlib.

We could add to parse() to look for a ? formatting character so you could write {:?} and get different behaviour. At the moment there's nothing that I would print differently and you don't get the distinction of a type being Debug but not Display. It would have to be Display in order to maybe also be Debug. In which case it's not worth doing anything with until we have types we want to print differently in a debug mode than in a "display" mode. But then.. those are normally types that are only Debug and in this case they'd have to be Display and just the user would not get nice stuff from them. Unless Debug was a long multiline thing and Display was a short thing? idk I don't see it yet, we can consider using the ? formatting character if we need it on a per-type basis or for all subspace types.

from subspace.

danakj avatar danakj commented on May 27, 2024

subspace/string/compat_stream.h will allow streaming of any (public) subspace type that is formattable.

from subspace.

danakj avatar danakj commented on May 27, 2024

For some reason the stream operator is not being picked up and used by GTest's ADL mechanisms on MSVC and it's breaking my brain. The decltype stuff for SFINAE all resolves when I reproduce it myself. Not sure if this is a blocker issue or what.

OK it was caching problems due to one TU seeing the operator<< template and one TU not, and compilers cacheing the first resulting GTest template for that type. Resolved by putting the operator<< template in prelude.h which it can do with just iosfwd.

Since we have operator<< there is no need for PrintTo.

from subspace.

danakj avatar danakj commented on May 27, 2024

I think #244 is sufficient to close this issue.

from subspace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.