POV-Ray : Newsgroups : povray.programming : C++ version Server Time
14 Mar 2025 09:34:58 EDT (-0400)
  C++ version (Message 1 to 3 of 3)  
From: Alessio Sangalli
Subject: C++ version
Date: 17 Dec 2021 13:31:15
Message: <61bcd773$1@news.povray.org>
Hello, what C++ version does the POV-Ray community want to target for 
the future? I see POV_CPP11_SUPPORTED that as far as I were able to 
understand is only used to define POVMS_NULLPTR, but older compilers are 
supported too anyway.

Is there any reason to continue to support compilers older than C++11? 
If we could just assume C++11 (or better, C++17) several sections of the 
code could be rewritten to take advantage of new features of the 
anguage. For example, I'd start with using constexpr instead of #define 
in a lot of cases; kinda of a low hanging fruit, but type checking for 
constants is in my opinion worth having in the 2020's.


Post a reply to this message

From: Chris Cason
Subject: Re: C++ version
Date: 23 Dec 2021 23:37:35
Message: <61c54e8f$1@news.povray.org>
On 18/12/2021 05:31, Alessio Sangalli wrote:
> Hello, what C++ version does the POV-Ray community want to target for 
> the future? I see POV_CPP11_SUPPORTED that as far as I were able to 
> understand is only used to define POVMS_NULLPTR, but older compilers are 
> supported too anyway.
> 
> Is there any reason to continue to support compilers older than C++11? 
> If we could just assume C++11 (or better, C++17) several sections of the 
> code could be rewritten to take advantage of new features of the 
> anguage. For example, I'd start with using constexpr instead of #define 
> in a lot of cases; kinda of a low hanging fruit, but type checking for 
> constants is in my opinion worth having in the 2020's.

This is a question best answered by Christoph Lipka, however I'll add my 
(informal) opinion, and that is with 4.0 we're quite open to changes 
like this. The main constraint (if it is even a constraint) is the 
availability of free, quality compilers that meet the C++11 or C++17 
standards on all the platforms that we target.

-- Chris


Post a reply to this message

From: Ray Gardener
Subject: Re: C++ version
Date: 6 Mar 2025 02:10:06
Message: <91a97f4e-48bc-4bf2-91a7-8064476043db@daylongraphics.com>
On 12/17/2021 10:31 AM, Alessio Sangalli wrote:
> Hello, what C++ version does the POV-Ray community want to target for 
> the future? I see POV_CPP11_SUPPORTED that as far as I were able to 
> understand is only used to define POVMS_NULLPTR, but older compilers are 
> supported too anyway.
> 
> Is there any reason to continue to support compilers older than C++11? 
> If we could just assume C++11 (or better, C++17) several sections of the 
> code could be rewritten to take advantage of new features of the 
> anguage. For example, I'd start with using constexpr instead of #define 
> in a lot of cases; kinda of a low hanging fruit, but type checking for 
> constants is in my opinion worth having in the 2020's.
> 

For what it's worth...

Visual Studio 2022 (or VS 17.x if you prefer) works fine, you only have 
to do this:

- Modify the BUILT_BY macro and comment out the related #error line in 
base/build.h like usual (if you haven't already).

- Comment out the inheritance of std::binary_function for the 
NameCompare struct in libraries/openexr/lmImf/mfAttribute.cpp
since std::binary_function is deprecated. Should be near line 65.

- In syspovconfig_msvc.h, add something like this to its list of MSVC 
toolchain definitions:

   #elif _MSC_VER >= 1940 && _MSC_VER < 1950
     #define POV_COMPILER_VER                  "msvc143"
     #define METADATA_COMPILER_STRING          "msvc 14.31"
     #define POV_CPP11_SUPPORTED               1


Ray Gardener


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.