| 1 |
|
| 2 |
template<typename _Tp> |
| 3 |
class allocator {}; |
| 4 |
|
| 5 |
template<typename _Alloc> struct allocator_traits; |
| 6 |
|
| 7 |
template<typename _Tp> |
| 8 |
struct allocator_traits <allocator<_Tp>> |
| 9 |
{ |
| 10 |
using pointer = _Tp*; |
| 11 |
}; |
| 12 |
|
| 13 |
struct mutex {}; |
| 14 |
|
| 15 |
template<typename _Tp, typename _Alloc> |
| 16 |
class Inplace |
| 17 |
{ |
| 18 |
public: |
| 19 |
virtual void _M_dispose() noexcept |
| 20 |
{ |
| 21 |
// bogus error ambiguous partial specializations |
| 22 |
typename allocator_traits<_Alloc>::pointer v; |
| 23 |
} |
| 24 |
}; |
| 25 |
|
| 26 |
inline void * |
| 27 |
allocate_shared() |
| 28 |
{ |
| 29 |
return new Inplace<mutex, allocator<mutex>> (); |
| 30 |
} |