nanort | NanoRT , single header only modern ray tracing kernel | GPU library
kandi X-RAY | nanort Summary
kandi X-RAY | nanort Summary
Path tracing example contributed by NanoRT is simple single header only ray tracing kernel.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nanort
nanort Key Features
nanort Examples and Code Snippets
Community Discussions
Trending Discussions on nanort
QUESTION
Here are the key points:
1: This project uses the open-source repository NanoRT as a raytracer in a project.
2: This project is compiled under Visual Studio 2019 (C++17)
3: This project is compiled with warnings treated as errors (and this cannot be changed). Adding the define to suppress these warnings did not help.
However, it looks like part of this code does not work in C++17, as it uses something that has become deprecated: (line 133 and 134 in the link I provided)
...ANSWER
Answered 2020-Jul-01 at 18:12Replace std::allocator::pointer
with T*
and std::allocator::size_type
with std::size_t
. That is what those deprecated member type aliases are defined as.
is this a few-line fix, or is this much more complicated than that and would require restructuring large portions of the code?
This seems like a trivial change.
The error suggests using
std::allocator_traits
std::allocator_traits
should be used if the allocator type is templated. That appears to not be the case here, and so using std::allocator_traits
would be unnecessary.
But if we were to fix the problem in a case where the allocator is templated: Let's say the template argument is Alloc
. Then you should replace Alloc::pointer
with std::allocator_traits::pointer
and Alloc::size_type
with std::allocator_traits::size_type
.
However, it looks like part of this code does not work in C++17, as it uses something that has become deprecated
Actually, use of deprecated features still works. It should still be fixed though since it will stop working in C++20. std::allocator::pointer
has been removed in C++20.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nanort
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page