Deutsch   English   Français   Italiano  
<20250102173514.0000191d@yahoo.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Michael S <already5chosen@yahoo.com>
Newsgroups: comp.lang.c++
Subject: Re: We have a new standard!
Date: Thu, 2 Jan 2025 17:35:14 +0200
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <20250102173514.0000191d@yahoo.com>
References: <C++-20241227154547@ram.dialup.fu-berlin.de>
	<20250101182527.00004b2f@yahoo.com>
	<vl3qpk$2rr3n$1@dont-email.me>
	<vl5dst$37mo5$2@dont-email.me>
	<vl5lvf$39de4$1@dont-email.me>
	<vl625a$3bj9b$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 02 Jan 2025 16:35:17 +0100 (CET)
Injection-Info: dont-email.me; posting-host="a487b285b1ee649d033fecbdc1f1f405";
	logging-data="3518458"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX188lC4YkAslaskidW5KEHGJqKnbZzzDp9c="
Cancel-Lock: sha1:HQ13MdUPiZU3vEBEia/KEp86wr8=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
Bytes: 2044

On Thu, 2 Jan 2025 13:51:53 +0100
David Brown <david.brown@hesbynett.no> wrote:

> 
> Could this all have been done from the start of C++?  In theory, yes
> - in practice no.  std::format and std::print rely on various modern
> C++ features, such as compile-time evaluation of functions, 

It does not look like dependence of std::format on compile-time
evaluation is a requirement of standard rather than implementation
choice of g++ and of clang++.

MSVC 19.30.30706 compiles the following code just fine:

#include <cstdio>
#include <format>

int main(int argc, char** argv)
{
  if (argc >= 3) {
    std::string s = std::format(argv[1], argv[2]);
    printf("%s\n", s.c_str());
  }
  return 0;
}

When run, it produces expected results.

Or, may be, it's because this version of MSVC is not fully C++20
complient.