Created
July 15, 2016 19:35
-
-
Save 4e1e0603/c941893da9228110887b79c8e5085d0a to your computer and use it in GitHub Desktop.
C++/SQL variadic macro
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
#include <string> | |
#include <iostream> | |
#define SQL(...) #__VA_ARGS__ | |
int main() | |
{ | |
std::string query(SQL( | |
SELECT | |
* | |
FROM | |
person | |
WHERE | |
id = 1 | |
)); | |
std::cout << query << std::endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment