Comments (7)
We need to look at other standard library types and do the same thing. No need to innovate here.
from value_types.
Perhaps I'm missing something but I can't get this example working for the use case. Currently, only the latest Visual Studio has support for the <print>
header, any ideas what I am missing to reproduce this: https://godbolt.org/z/ahWacdanP
from value_types.
Here is the original sample: https://godbolt.org/z/zh9czreoK
Here is a "simplified" version which does not involve ranges, but my own custom type that is only formattable in a non-const verison (MyNonConstFormattableType
) https://godbolt.org/z/sqoE5Txfj
It seems that both only work with clang 17.0.1 and options: -std=c++23 -stdlib=libc++
from value_types.
Regarding a solution: I just checked https://eel.is/c++draft/format.tuple#lib:format,formatter . This is the std::formatter
for std::pair
and std::tuple
. The approach seems to be: If const T
is formattable, then format
takes a const std::tuple<T>&
as parameter, otherwise it takes a std::tuple<T>&
as parameter. Something similar was done at https://eel.is/c++draft/format.range, too.
from value_types.
I just learned, that libc++ does not define the macro __cpp_lib_format
yet. This gets used in https://github.com/jbcoe/value_types/blob/main/indirect.h#L348 . So therefore under libc++ (which all my godbolt-samples used), the code will never work, because the #ifdef (#if (__cpp_lib_format >= 201907L)
) in indirect.h
will always be false.
from value_types.
Feel free to add your experiment in a PR and piggy-back off our test setup. We run on MSVC, Clang and GCC.
from value_types.
We've stripped out format support altogether so this is no longer an issue.
from value_types.
Related Issues (20)
- Add unit tests for trivially-relocatable
- Add tests to ensure types correctly use `allocator_traits<A>::pointer`, ideally based on `boost::offset_ptr` HOT 3
- Fix wording for move constructors when `allocator_traits::is_always_equal` is false
- Document the existence of pre-c++20 and experimental implementations of indirect and polymorphic
- P3019R4 says that polymorphic's moved-from state is valueless, which is not the author's intent HOT 1
- Update assignment wording
- Add explicit discussion of why valueless_after_move is needed
- Discuss indirect's non-conditional copy ctor in the light of concept trickery HOT 1
- Add a response to stack overflow question about polymorphism and pointers HOT 1
- Get CI running on a schedule on main
- Re-enable ASAN and TSAN on Bazel HOT 1
- Redundant condition in polymorphic's constraints HOT 2
- polymorphic_inline_vtable.h doesn't support moving with non-equal allocator HOT 3
- polymorphic's control block does not construct the object using the allocator HOT 1
- Add indirect and polymorphic to the ISO C++ Standard
- Don't delegate constructors in formal wording
- Pull Throws clause out of constructors and put it into a common block like wg21.link/P2642
- Remove remove_const from hash wording
- Align comparisons with those in reference wrapper
- Rewrite tests from scratch to test different types and allocators
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from value_types.