| 239 | |
| 240 | template<typename Visitor> |
| 241 | auto apply_visitor(Visitor&& visitor, std::size_t index) const { |
| 242 | if (index >= size()) { |
| 243 | throw IfcParse::IfcException( |
| 244 | "Index " + std::to_string(index) + " is out of range for variant of size " + std::to_string(size()) |
| 245 | ); |
| 246 | } |
| 247 | return apply_visitor_impl(std::forward<Visitor>(visitor), index, std::integral_constant<std::size_t, sizeof...(Types)>{}); |
| 248 | } |
| 249 | |
| 250 | size_t size() const { |
| 251 | return size_and_indices_ ? size_and_indices_[0] : 0; |
no test coverage detected