🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.comp.lang.c++.misc
1 messages
1 total messages Started by Student Project Fri, 29 Nov 2024 05:49
Modern C++
#1
Author: Student Project
Date: Fri, 29 Nov 2024 05:49
18 lines
1392 bytes
Which compiler is currently able to compile this two code snippets:

std::vector<int> v = {1, 2, 3, 4, 5};
std::println("{}", v);


Suppose you want it to be centered in a line of 40 characters, with 
underscore characters around it:

std::vector<int> v = {1, 2, 3, 4, 5};
std::println("{:_^40}", v);
// ____________[1, 2, 3, 4, 5]_____________


Source: 
<https://isocpp.org/blog/2024/11/having-fun-with-modern-cpp-daniel-lemire>

Thank you for reading this and possible solution.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads