It doesn't need to resize the vector since it can just use the default
flag.
void unblock() { get<T>() = UNBLOCKED; }
template<typename T>
- void check() { if(get<T>()!=UNBLOCKED) throw invalid_access(T::describe()); }
+ void check();
};
inline void AccessGuard::unblock<void>()
{ unblock_all(); }
+template<typename T>
+inline void AccessGuard::check()
+{
+ unsigned index = get_index<T>();
+ if((index<flags.size() ? flags[index] : default_flag) != UNBLOCKED)
+ throw invalid_access(T::describe());
+}
+
template<typename T>
inline std::string AccessGuard::Read<T>::describe()