Skip to content

Test and document binding protected member functions #1013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2017

Conversation

dean0x7d
Copy link
Member

Resolves #991.

This isn't a new feature, it just documents a pattern for exposing protected member functions as discussed in #991.

The test revealed a bug on MSVC 2015 (fixed already in 2017):

struct A {
    void foo() { return 42; }
};

struct B1 : A {};
struct B2 : A { using A::foo; };

static_assert(std::is_member_function_pointer<decltype(&B1::foo)>::value, "");
static_assert(std::is_member_function_pointer<decltype(&B2::foo)>::value, "");

The second static_assert fails only on MSVC 2015. I've noted a workaround in the docs.

@dean0x7d dean0x7d added this to the v2.2 milestone Aug 20, 2017
@dean0x7d dean0x7d merged commit 234f7c3 into pybind:master Aug 22, 2017
@dean0x7d dean0x7d deleted the docs branch August 22, 2017 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression when binding alias functions
1 participant