|
#pragma once
#include "boolean_converter_fwd.hpp"
namespace tomato {
// bool and BOOL
template< >
struct boolean_converter<bool, BOOL>
{
static bool convert(BOOL b)
{
return b != 0;
}
};
template< >
struct boolean_converter<BOOL, bool>
{
static BOOL convert(bool b)
{
return b ? 1 : 0;
}
};
// bool and LRESULT
template< >
struct boolean_converter<bool, LRESULT>
{
static bool convert(LRESULT lResult)
{
return lResult != 0;
}
};
template< >
struct boolean_converter<LRESULT, bool>
{
static LRESULT convert(bool b)
{
return b ? 1 : 0;
}
};
// BOOL and LRESULT
template< >
struct boolean_converter<BOOL, LRESULT>
{
static BOOL convert(LRESULT lResult)
{
return lResult != 0 ? 1 : 0;
}
};
template< >
struct boolean_converter<LRESULT, BOOL>
{
static LRESULT convert(BOOL b)
{
return b != 0 ? 1 : 0;
}
};
} // namespace tomato
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here