MeshLib
 
Loading...
Searching...
No Matches
MRBindingMacros.h
Go to the documentation of this file.
1#pragma once
2
3// Those macros help control Python bindings generated using MRBind.
4
5// MR_PARSING_FOR_PB11_BINDINGS - gets defined when parsing the source code
6// MR_COMPILING_PB11_BINDINGS - gets defined when compiling the resulting bindings
7
8// Use to specify valid template arguments for templates (usually function templates).
9// For example:
10// template <typename T> void foo(T) {...};
11// MR_BIND_TEMPLATE( void foo(int) )
12// MR_BIND_TEMPLATE( void foo(float) )
13//
14// As with `extern template`, you might need to use `foo<...>` instead of `foo` if the template parameters can't be deduced from the
15// parameter types and the return type.
16#ifdef MR_PARSING_FOR_PB11_BINDINGS
17#define MR_BIND_TEMPLATE(...) extern template __VA_ARGS__;
18#else
19#define MR_BIND_TEMPLATE(...)
20#endif