novelrt / NovelRT

A cross-platform 2D game engine accompanied by a strong toolset for visual novels.
MIT License
183 stars 43 forks source link

Feature/novelrt span alias #551

Closed Pheubel closed 1 year ago

Pheubel commented 1 year ago

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) This PR introduces NovelRT::Utilities::Misc::Span as alias to gsl::span and std::span according to https://github.com/novelrt/NovelRT/issues/532

Is there an open issue that this resolves? If so, please link it here. https://github.com/novelrt/NovelRT/issues/532

What is the current behavior? (You can also link to an open issue here) Currently across the NovelRT engine gsl::span is used directly

What is the new behavior (if this is a feature change)? NovelRT will continue to use gsl::span by default, but through an aliased. Through defining NOVELRT_USE_STD_SPAN it will attempt to use C++ 20's std::span instead.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?) This PR does not introduce any breaking changes, as NovelRT::Utilities::Misc::Span will still use gsl::span by default. In order to make use of std::span, developers will first have to opt-in.

Other information: This PR currently only makes changes for C++, it might be possible to create an option in CMake to have it be easier to use.