Last active
December 31, 2015 11:18
-
-
Save r0mai/7978397 to your computer and use it in GitHub Desktop.
mpq_rational asserts
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 <boost/variant.hpp> | |
#include <boost/multiprecision/gmp.hpp> | |
struct Foo { | |
Foo() {} | |
Foo(const Foo&) {} | |
}; | |
int main() { | |
typedef boost::multiprecision::mpq_rational Num; | |
typedef boost::variant<Foo, Num> Variant; | |
Variant x = Num(2); | |
Variant y = std::move(x); | |
x = Foo(); | |
} |
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
#This Makefile assumes libgmp is installed under /usr/local | |
test: main.cpp | |
g++ -std=c++11 $^ /usr/local/lib/libgmp.a -O0 -g -o $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment