#ifndef MIGRAPH_GUARD_ROB_HPP #define MIGRAPH_GUARD_ROB_HPP #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif // Used to access private member variables template struct stowed { static typename Tag::type value; }; template typename Tag::type stowed::value; template struct stow_private { stow_private() noexcept { stowed::value = X; } static stow_private instance; }; template stow_private stow_private::instance; template struct mem_data_ptr { using type = T C::*; }; #define MIGRAPH_ROB(name, Type, C, mem) \ struct name##_tag : mem_data_ptr \ { \ }; \ template struct stow_private; \ template \ auto& name(T&& x) \ { \ return x.*stowed::value; \ } #ifdef __clang__ #pragma clang diagnostic pop #endif #endif