1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-18 08:22:04 +00:00

util: update function dtors, update gitignore

This commit is contained in:
Michael Scire 2022-03-13 13:51:15 -07:00 committed by SciresM
parent 9911c44670
commit 9866285f0e
2 changed files with 6 additions and 1 deletions

3
.gitignore vendored
View file

@ -93,6 +93,7 @@ dkms.conf
**/out
**/build
**/lib
**/build_nintendo_nx_arm64
**/build_nintendo_nx_arm64_armv8a
**/build_nintendo_nx_arm
@ -102,6 +103,8 @@ dkms.conf
**/build_nintendo_nx_x64
**/build_nintendo_nx_x86
tools/*/
package3
stratosphere/test/

View file

@ -58,6 +58,7 @@ namespace ams::util {
F m_f;
public:
constexpr explicit Function(F f) : m_f(std::move(f)) { /* ... */}
constexpr virtual ~Function() override { /* ... */ }
constexpr virtual R operator()(Args... args) const override final {
return m_f(std::forward<Args>(args)...);
@ -68,6 +69,7 @@ namespace ams::util {
class Function<R(Args...), F, typename std::enable_if<std::is_class<F>::value && !std::is_final<F>::value>::type> final : public IFunction<R(Args...)>, private F {
public:
constexpr explicit Function(F f) : F(std::move(f)) { /* ... */}
constexpr virtual ~Function() override { /* ... */ }
constexpr virtual R operator()(Args... args) const override final {
return static_cast<const F &>(*this).operator()(std::forward<Args>(args)...);
@ -90,7 +92,7 @@ namespace ams::util {
template<typename R, typename... Args>
class IFunction<R(Args...)> {
protected:
constexpr virtual ~IFunction() = default;
constexpr virtual ~IFunction() { /* ... */ };
public:
constexpr virtual R operator()(Args... args) const = 0;