Files
Marc RousavyandGitHub 6dbb34f9d3 fix: Add NON_NULL, NULLABLE and CONTIGUOUS_MEMORY annotations on pointers (#902)
* chore: Add `NON_NULL` and `NULLABLE` annotations on all pointers

* feat: Add `CONTIGUOUS_MEMORY` and `NON_NULL`

* Create `InstanceMethod<...>`

* chore: Use `InstanceMethod<...>`
2025-09-26 13:45:54 +02:00

24 lines
603 B
C++

//
// InstanceMethod.hpp
// NitroModules
//
// Created by Marc Rousavy on 25.09.25.
//
#pragma once
#include "NitroDefines.hpp"
namespace margelo::nitro {
/**
* Represents a Function pointer to an instance method of the given class.
* For example:
* `InstanceMethod<std::string, size_t>` could point to `size_t std::string::length()`
* `InstanceMethod<std::vector<int>, void, int>` could point to `void std::vector<int>::push_back(int)`
*/
template <typename T, typename ReturnType, typename... Args>
using InstanceMethod = ReturnType (T::*NON_NULL)(Args...);
} // namespace margelo::nitro