c++ - noexcept depending on method of member -
related this question, want specify private section after public interface.
template<class t, void (t::*f)()> class b { public: void g(int y) noexcept(noexcept(x.*f())) {} private: t& x; };
but error clang x undeclared identifyer.
mm_test.cpp:14:34: error: use of undeclared identifier 'x' void g(int y) noexcept(noexcept(x.*f())) ^
it compiles fine if declaration of member x occurs before declaration of g. not supposed able use member variable in noexcept operator earlier in class definition declaration? if not, how achieve equivalent noexcept specifier without moving declaration of x ahead?
Comments
Post a Comment