Page MenuHomePhabricator

Fix compile errors in Amount caused by ambiguous instantation
ClosedPublic

Authored by tomtomtom7 on Oct 10 2017, 14:13.

Details

Summary

Amount(long long) was ambiguous causing compile errors. Instantiation is now generalized to all integers

Test Plan

None; minor refactoring only

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Oct 10 2017, 14:13

I've added Amaury as a reviewer. He did not like using a template for some reason in previous revisions.

src/amount.h
22 ↗(On Diff #1533)

Originally I had used:

template <typename T, typename std::enable_if<(std::is_integral<T>::value).  T>::type = 0>

rather than a static_assert

You should include type_traits also I think?

src/amount.h
22 ↗(On Diff #1533)

static assert sounds much clearer. is there a way to get an error message out of it ?

Add message to static assert

This revision is now accepted and ready to land.Oct 10 2017, 15:16
This revision was automatically updated to reflect the committed changes.