Skip to content

Instantly share code, notes, and snippets.

@gununu
gununu / main.cpp
Created March 8, 2011 11:11
safe sign-type cast
#include "sign_cast.hpp"
int main() {
char* a = 0;
unsigned char* x = sign_cast<unsigned char*>(a); //ok
sign_cast<char*>(a); //ok
sign_cast<signed char*>(a); //ok
//sign_cast<wchar_t*>(a); //error
sign_cast<const char*>(a); //ok
sign_cast<char*const>(a); //ok
@gununu
gununu / static_if.hpp
Last active September 24, 2015 23:37
STATIC_IF library for C++
Please refer new C++14 static_if library
https://github.com/gununu/static_if
@gununu
gununu / gilpreview.hpp
Created July 12, 2010 15:32
boost::gil preview library for windows
/*
Use, modification and distribution are subject to the Boost Software License,
Version 1.0. (http://www.boost.org/LICENSE_1_0.txt).
*/
#ifndef GUNUNU_GIL_PREVIEW_HPP
#define GUNUNU_GIL_PREVIEW_HPP
#include <windows.h>
#pragma comment(lib, "user32")