File indexing completed on 2024-05-12 16:59:21

0001 /*
0002  *   SPDX-FileCopyrightText: 2015-2016 Ivan Cukic <ivan.cukic@kde.org>
0003  *
0004  *   SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 #ifndef PTR_TO_H
0008 #define PTR_TO_H
0009 
0010 namespace kamd
0011 {
0012 namespace utils
0013 {
0014 enum {
0015     Const = 0,
0016     Mutable = 1,
0017 };
0018 
0019 template<typename T, int Policy = Const>
0020 struct ptr_to {
0021     typedef const T *const type;
0022 };
0023 
0024 template<typename T>
0025 struct ptr_to<T, Mutable> {
0026     typedef T *const type;
0027 };
0028 
0029 } // namespace utils
0030 } // namespace kamd
0031 
0032 #endif // PTR_TO_H