You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/api/resolve.rst
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ utility to pick overloaded C++ function calls
19
19
int overloaded(int x, int y, int z);
20
20
21
21
struct thing {
22
+
int overloaded() const;
22
23
int overloaded(int x);
23
24
int overloaded(int x, int y);
24
25
int overloaded(int x, int y, int z);
@@ -33,8 +34,9 @@ You can disambiguate them using ``resolve``:
33
34
auto two_argument_func = resolve<int(int, int)>( overloaded );
34
35
auto three_argument_func = resolve<int(int, int, int)>( overloaded );
35
36
auto member_three_argument_func = resolve<int(int, int, int)>( &thing::overloaded );
37
+
auto member_zero_argument_const_func = resolve<int() const>( &thing::overloaded );
36
38
37
-
This resolution becomes useful when setting functions on a :doc:`table<table>` or :doc:`state_view<state>`:
39
+
It is *important* to note that ``const`` is placed at the end for when you desire const overloads. You will get compiler errors if you are not specific and do not properly disambiguate for const member functions. This resolution also becomes useful when setting functions on a :doc:`table<table>` or :doc:`state_view<state>`:
0 commit comments