dalerank / nanogui-sdl

Minimalistic port of NanoGUI claim works with SDL API w/o external dependencies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not compile in C++17

ville-v opened this issue · comments

std::unary_function is removed in C++17, therefore nanort.h does not compile. https://en.cppreference.com/w/cpp/utility/functional/unary_function

Tested in Visual Studio 2022.

can u fix it with pr?

I don't know what this class does (how to replace it) and the original nanogui does not have this file. So I used another GUI library instead.

Sure, is it new version?

commented

Sure, is it new version?

Something like a new version with an other problem:
https://github.com/lighttransport/nanort/blob/0bfd8fa97e979b3636136840cbe6cc70b8bc9f08/nanort.h#L131

 class StackAllocator : public std::allocator<T> {

https://en.cppreference.com/w/cpp/memory/allocator

So isn't work with c++20

But is there anyway.

class StackAllocator : public std::allocator<T> {

I think std::allocator_traits can replace std::allocator. Nanogui-sdl uses std::allocator in some other places and replacing those was recommended by Visual Studio.

https://en.cppreference.com/w/cpp/memory/allocator_traits

According to this, std::allocator is removed because it is (at least partially) duplicate of std::allocator_traits: https://stackoverflow.com/questions/39414610/why-are-are-stdallocators-construct-and-destroy-functions-deprecated-in-c17