Skip to content

Instantly share code, notes, and snippets.

@r0mai
Last active December 31, 2015 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r0mai/7978397 to your computer and use it in GitHub Desktop.
Save r0mai/7978397 to your computer and use it in GitHub Desktop.
mpq_rational asserts
#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 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