| 2962 | |
| 2963 | template<typename T> |
| 2964 | struct attr_reset |
| 2965 | { |
| 2966 | attr_reset(T & x) : x_(std::addressof(x)) {} |
| 2967 | attr_reset(attr_reset const &) = delete; |
| 2968 | attr_reset(attr_reset &&) = delete; |
| 2969 | attr_reset & operator=(attr_reset const &) = delete; |
| 2970 | attr_reset & operator=(attr_reset &&) = delete; |
| 2971 | ~attr_reset() |
| 2972 | { |
| 2973 | if (x_) |
| 2974 | *x_ = T(); |
| 2975 | } |
| 2976 | |
| 2977 | bool operator=(bool b) |
| 2978 | { |
| 2979 | if (b) |
| 2980 | x_ = nullptr; |
| 2981 | return b; |
| 2982 | } |
| 2983 | |
| 2984 | private: |
| 2985 | T * x_; |
| 2986 | }; |
| 2987 | } |
| 2988 | |
| 2989 | #ifndef BOOST_PARSER_DOXYGEN |
nothing calls this directly
no outgoing calls
no test coverage detected