Ticket #7584: unique_ptr_1.51_assign_ambiguous.cpp
| File unique_ptr_1.51_assign_ambiguous.cpp, 327 bytes (added by , 10 years ago) |
|---|
| Line | |
|---|---|
| 1 | #include <boost/interprocess/smart_ptr/unique_ptr.hpp> |
| 2 | using namespace boost::interprocess; |
| 3 | |
| 4 | struct poly_deleter |
| 5 | { |
| 6 | template<typename T> |
| 7 | void operator()(T *p) |
| 8 | { |
| 9 | delete p; |
| 10 | } |
| 11 | }; |
| 12 | |
| 13 | typedef unique_ptr<int, poly_deleter> u_ptr; |
| 14 | |
| 15 | u_ptr func() |
| 16 | { |
| 17 | return u_ptr(); |
| 18 | } |
| 19 | |
| 20 | int main() |
| 21 | { |
| 22 | u_ptr u; |
| 23 | u = func(); |
| 24 | } |
| 25 |
