Comments (5)
Since {fmt} disallows arbitrary pointers you still need a cast in which case
volatile
can be omitted. Is there a more compelling example?
I think a more compelling example is that you have actually a volatile T* p
for formatting, but it doesn't suffice to add apply static_cast<const void*>
to p
in your code, but you also need to add another const_cast<const T*>
to it first.
from fmt.
What the submitter is referring to is the adopted paper P1147.
from fmt.
Since {fmt} disallows arbitrary pointers you still need a cast in which case volatile
can be omitted. Is there a more compelling example?
from fmt.
lets say I have a volatile int*
and want to format it I have to do this
volatile int* p = (int*)0xdeadbeef;
fmt::format("{}",const_cast<void*>(static_cast<volatile void*>(p))); // or do static_cast<void*>(const_cast<int*>(p))
if fmt allowed to print const volatile void*
then I do not need the last const cast.
the godbolt link was to show that you can't print it
from fmt.
Makes sense, a PR to avoid volatile void*
support would be welcome.
from fmt.
Related Issues (20)
- Warning from flockfile HOT 2
- a strange problem HOT 1
- ubuntu 24.04 with g++-14 failes with internal compiler error HOT 5
- 11.0.1 MSVC 2015 Build error HOT 2
- Undefined symbol error when using fmt::windows_error in header-only mode HOT 4
- Mixing named and automatically indexed placeholders HOT 3
- Potential performance regression of vformat_to in libfmt 11 compared to libfmt 10.2.1 HOT 4
- Simple Execution g++ -g fmt.cpp -I "fmt\include" -o fmt.exe HOT 3
- https://fmt.dev/latest/api.html in error message is a 404 HOT 1
- Formatting `year_month_day` does not work on clang 18.1.0 or earlier, on GCC 13.3 and earlier HOT 1
- Cannot compile any date formatter for std::chrono::seconds HOT 4
- How to format to std::pmr::string HOT 1
- 11.0.1 Compile error with no OS HOT 2
- Error on `iterator_category = int` with GCC 13 HOT 2
- Alternative and more robust way of managing and working around #2708 HOT 5
- FMT_ATTACH_TO_GLOBAL_MODULE does not compile with clang HOT 6
- Input support HOT 1
- Slow Build Speed and High Memory Usage During Build with `--parallel` HOT 1
- Error, custom templated type with iterators compiled with clang-17 HOT 1
- microseconds formatting requires unicode
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 fmt.