Last active
December 13, 2015 20:18
-
-
Save bkuhns/4968512 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main() | |
course.where(course.name == "Argh" && course.name == "Test"); | |
////////////////////// | |
// FieldExpression.h | |
////////////////////// | |
// && operator for two FieldExpression<>'s. | |
template<typename L, typename R> | |
auto operator&&(const FieldExpression<Field<L>, L>& lhs, const FieldExpression<Field<R>, R>& rhs) -> decltype( MakeFieldExpression(lhs, OpAnd, rhs) ) | |
{ | |
return MakeFieldExpression(lhs, OpAnd, rhs); | |
} | |
template<typename LHS, typename RHS> | |
std::string FieldExpression<LHS, RHS>::toString() const | |
{ | |
ostringstream str; | |
str << "(" << lhs_.toString() << ") " << operatorToString(operator_) << " (" << rhs_.toString() << ")"; | |
return str.str(); | |
} | |
/************** | |
*** OUTPUT *** | |
**************/ | |
SELECT * FROM `Course` WHERE (`Course.name` = 'Argh') AND (`Course.name` = 'Test') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment