Skip to content

Instantly share code, notes, and snippets.

@afabri
Created March 10, 2023 13:08
Show Gist options
  • Save afabri/fcd036af9a1258b3d9d0bfd9977fd932 to your computer and use it in GitHub Desktop.
Save afabri/fcd036af9a1258b3d9d0bfd9977fd932 to your computer and use it in GitHub Desktop.
Problem with expression templates of boost::mp
#include <boost/multiprecision/cpp_int.hpp>
typedef boost::multiprecision::cpp_rational Rat;
struct E {
Rat rat;
E(const Rat& rat)
: rat(rat)
{}
};
int main()
{
Rat r(1,3);
E e = 2 * r;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment