ivl 679
|
00001 /* This file is part of the ivl C++ library <http://image.ntua.gr/ivl>. 00002 A C++ template library extending syntax towards mathematical notation. 00003 00004 Copyright (C) 2012 Yannis Avrithis <iavr@image.ntua.gr> 00005 Copyright (C) 2012 Kimon Kontosis <kimonas@image.ntua.gr> 00006 00007 ivl is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU Lesser General Public License 00009 version 3 as published by the Free Software Foundation. 00010 00011 Alternatively, you can redistribute it and/or modify it under the terms 00012 of the GNU General Public License version 2 as published by the Free 00013 Software Foundation. 00014 00015 ivl is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00018 See the GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 and a copy of the GNU Lesser General Public License along 00022 with ivl. If not, see <http://www.gnu.org/licenses/>. */ 00023 00024 00025 template <> struct to_signed<bool> : public to_type <char> { }; 00026 00027 template <> struct to_signed<uint8_t> : public to_type <int8_t> { }; 00028 00029 template <> struct to_signed<uint16_t> : public to_type <int16_t> { }; 00030 00031 template <> struct to_signed<uint32_t> : public to_type <int32_t> { }; 00032 00033 template <> struct to_signed<uint64_t> : public to_type <int64_t> { }; 00034 00035 //--------------------------------------------------------------------------- 00036 00037 template <> struct to_unsigned<int8_t> : public to_type<uint8_t> { }; 00038 00039 template <> struct to_unsigned<int16_t> : public to_type <uint16_t> { }; 00040 00041 template <> struct to_unsigned<int32_t> : public to_type <uint32_t> { }; 00042 00043 template <> struct to_unsigned<int64_t> : public to_type <uint64_t> { }; 00044 00045 00046 #ifndef _MSC_VER 00047 // g++ has a special type for `char' which is neither 00048 // int8_t nor int16_t but a type of its own, whatever implementation 00049 // is used. So it has to be specially treated. 00050 // This does not hold for unsigned char though. 00051 template <> struct to_unsigned<char> : public to_type <unsigned char> { }; 00052 #endif