blob: ec6d61099455f22ac74d644d1ef21f18b345f8dd [file] [log] [blame]
Jeff Thompson3d613fd2013-10-15 15:39:04 -07001#ifndef NDNBOOST_POINTER_TO_OTHER_HPP_INCLUDED
2#define NDNBOOST_POINTER_TO_OTHER_HPP_INCLUDED
Jeff Thompsona28eed82013-08-22 16:21:10 -07003
4//
5// pointer_to_other.hpp
6//
7// (C) Copyright Ion Gaztanaga 2005.
8// Copyright (c) 2005 Peter Dimov.
9//
10// Distributed under the Boost Software License, Version 1.0.
11//
12// (See accompanying file LICENSE_1_0.txt or copy at
13// http://www.boost.org/LICENSE_1_0.txt)
14//
15// See http://www.boost.org/libs/smart_ptr/pointer_to_other.html
16//
17
18namespace ndnboost
19{
20
21// Defines the same pointer type (raw or smart) to another pointee type
22
23template<class T, class U>
24struct pointer_to_other;
25
26template<class T, class U,
27 template<class> class Sp>
28struct pointer_to_other< Sp<T>, U >
29{
30 typedef Sp<U> type;
31};
32
33template<class T, class T2, class U,
34 template<class, class> class Sp>
35struct pointer_to_other< Sp<T, T2>, U >
36{
37 typedef Sp<U, T2> type;
38};
39
40template<class T, class T2, class T3, class U,
41 template<class, class, class> class Sp>
42struct pointer_to_other< Sp<T, T2, T3>, U >
43{
44 typedef Sp<U, T2, T3> type;
45};
46
47template<class T, class U>
48struct pointer_to_other< T*, U >
49{
50 typedef U* type;
51};
52
53} // namespace ndnboost
54
Jeff Thompson3d613fd2013-10-15 15:39:04 -070055#endif // #ifndef NDNBOOST_POINTER_TO_OTHER_HPP_INCLUDED