So far it seems like the answer is no.
Which is unfortunate given how much more visually noisy code becomes with shared_ptrs
all over the place.
With C++11, one possible way to do that now is to use aliases (which are cleaner imo than macros). Eg for shared pointers, you could do:
template<typename T>
using Shared = std::shared_ptr<T>;
Then, use it like the following:
Shared<int> myInt; // Is in fact a std::shared_ptr<int>
EDIT: Live example .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.