Created
February 5, 2016 22:26
-
-
Save EricWF/241e48bcc265ff3cf772 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace ns1 { | |
| class A {}; | |
| class B { | |
| typedef ::ns1::A AT; | |
| public: | |
| operator AT const&() const noexcept { | |
| return m_a; | |
| } | |
| AT A() const { return m_a; } | |
| AT m_a; | |
| }; | |
| } | |
| int main() { | |
| using namespace ns1; | |
| B b; | |
| static_assert(noexcept(b.operator A const&()), ""); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment