Some days ago I looked at boost sources and found interesting typedef.
There is a code from “boost\detail\none_t.hpp”:
namespace boost {
namespace detail {
struct none_helper{};
typedef int none_helper::*none_t ;
} // namespace detail
} // namespace boost
I didn’t see syntax like that earlier and can’t explain the sense of that.
This typedef introduces name “none_t” as pointer to int in boost::detail namespace.
What the syntax is?
And what difference between “typedef int none_helper::*none_t” and for example “typedef int *none_t” ?
The syntax is for a pointer to member – here it typedefs
none_tas a pointer to anintdata member ofnone_helper.The syntax can be used e.g. this way:
InformIT has an article on member pointers, containing more details.