Skip to content

Instantly share code, notes, and snippets.

@EricWF
Created February 5, 2016 22:26
Show Gist options
  • Select an option

  • Save EricWF/241e48bcc265ff3cf772 to your computer and use it in GitHub Desktop.

Select an option

Save EricWF/241e48bcc265ff3cf772 to your computer and use it in GitHub Desktop.
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