In this video we look at the basics of printing with std::print! Compiler Explorer Link: godbolt.org/z/... cppreference Link: en.cppreferenc... For code samples: github.com/coff... For live content: / coffeebeforearch
Пікірлер: 6
@ohwow20745 ай бұрын
Nice that you started with C++23
@theintjengineer5 ай бұрын
Yaaay. New C++ stuff❤
@udomtipparach48943 ай бұрын
I used VS code on windows 10, but it doesn't work. how can I run C++23 on VS code windows 10?
@enkidughom25085 ай бұрын
Hey Nick! Do you do 1-on-1 mentoring? I am a deep learning engineer by trade. I have a CS and applied math degree and want to switch to doing deeplearning compiler and performance engineering.
@anon_y_mousse5 ай бұрын
This will sound kind of weird, but I'm disappointed with the committee for adding yet another method for printing things, yet still not adding f-strings. Positional arguments are error prone and it's better for correctness to use std::cout even if it looks like garbage. However, if they had added f-strings, and admittedly that'd take a LOT of effort from compiler authors to implement, they could get a nice clean syntax that eliminates the positional argument problems. Probably not interesting, but I found when implementing them for my own language, that as I was doing so from scratch it was actually not particularly difficult to fit them in. Basically, I just have my compiler load const sections and run them at compile time and where types are not fully formed at compile time I split the string at those points and generate a call for the appropriate conversion function at run time. So in the worst case it works like std::cout, and in the best case it works like std::fputs() with a string literal. Of course, I fully admit that because I was doing things from scratch it was significantly easier to implement as I designed around this as one of my goals, but for preexisting compilers, especially those that use parser/lexer generators, it's not going to be as easy.