1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

sprout/weed/context/parse_context/operator/minus.hpp 追加

sprout/weed/context/parse_context/operator/negate.hpp 追加
This commit is contained in:
bolero-MURAKAMI 2011-11-14 19:45:59 +09:00
parent 005f8a9a87
commit a7698fa6e9
13 changed files with 291 additions and 1 deletions

View file

@ -0,0 +1,28 @@
#ifndef SPROUT_WEED_ATTR_CNV_NEGATE_HPP
#define SPROUT_WEED_ATTR_CNV_NEGATE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/weed/unused.hpp>
#include <sprout/weed/traits/type/is_unused.hpp>
#include <sprout/weed/attr_cnv/result_of/negate.hpp>
namespace sprout {
namespace weed {
namespace attr_cnv {
//
// negate
//
// !unused -> unused
template<typename T>
SPROUT_CONSTEXPR inline typename std::enable_if<
sprout::weed::traits::is_unused<T>::value,
typename sprout::weed::attr_cnv::result_of::negate<T>::type
>::type negate(T const& t, bool cond) {
return sprout::weed::unused();
}
} // namespace attr_cnv
} // namespace weed
} // namespace sprout
#endif // #ifndef SPROUT_WEED_ATTR_CNV_NEGATE_HPP

View file

@ -3,6 +3,7 @@
#include <sprout/config.hpp>
#include <sprout/weed/attr_cnv/result_of/times.hpp>
#include <sprout/weed/attr_cnv/result_of/negate.hpp>
#include <sprout/weed/attr_cnv/result_of/shift_left.hpp>
#include <sprout/weed/attr_cnv/result_of/modulus.hpp>
#include <sprout/weed/attr_cnv/result_of/bitwise_or.hpp>

View file

@ -0,0 +1,34 @@
#ifndef SPROUT_WEED_ATTR_CNV_RESULT_OF_NEGATE_HPP
#define SPROUT_WEED_ATTR_CNV_RESULT_OF_NEGATE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/weed/unused.hpp>
#include <sprout/weed/traits/type/is_unused.hpp>
namespace sprout {
namespace weed {
namespace attr_cnv {
namespace result_of {
//
// negate
//
template<typename T, typename = void>
struct negate;
// -unused -> unused
template<typename T>
struct negate<
T,
typename std::enable_if<
sprout::weed::traits::is_unused<T>::value
>::type
> {
public:
typedef sprout::weed::unused type;
};
} // namespace result_of
} // namespace attr_cnv
} // namespace weed
} // namespace sprout
#endif // #ifndef SPROUT_WEED_ATTR_CNV_RESULT_OF_NEGATE_HPP