forked from kljohann/genpybind-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault_arguments.h
43 lines (34 loc) · 1.24 KB
/
default_arguments.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include "genpybind.h"
template <typename T, int N> struct Tpl {};
struct GENPYBIND(visible) X {};
inline void GENPYBIND(visible) function_builtin(int x = 5, bool arg = true) {}
inline void GENPYBIND(visible) function_class(X x = X()) {}
namespace example {
struct GENPYBIND(visible) Y {
static constexpr int N = 42;
};
inline void GENPYBIND(visible) function_class_in_namespace(Y y = Y()) {}
} // namespace example
inline void GENPYBIND(visible)
function_class_outside_namespace(example::Y y = example::Y()) {}
// TODO: genpybind uses `example::Y::N` as default argument?
/*
void GENPYBIND(visible) function_template_outside_namespace(
Tpl<example::Y, example::Y::N> y = Tpl<example::Y, example::Y::N>()) {}
*/
// TODO: genpybind fails to expand `Y::N` to fully qualified expression
/*
namespace example {
void GENPYBIND(visible)
function_template_in_namespace(Tpl<Y, Y::N> y = Tpl<Y, Y::N>()) {}
} // namespace example
*/
// TODO: braced initialization not supported in default argument
/*
void GENPYBIND(visible) function_braced(X x = {}) {}
namespace example {
void GENPYBIND(visible) function_braced_in_namespace(Y y = {}) {}
} // namespace example
void GENPYBIND(visible) function_braced_outside_namespace(example::Y y = {})
*/