mbed_atomic.h: Improve template type deduction
Avoid template ambiguities using type_identity_t.

Previously the compiler would be unable to figure out whether

     uint8_t x;
     core_util_atomic_store(&x, 0);

should invoke core_util_atomic_store<uint8_t>, matching the pointer
type, or core_util_atomic_store<int>, matching the value, leading to
an ambiguity error.

Templates now select only on the type of the atomic pointer parameter.
ls
1 parent 3fd7e11 commit 5d2b37d205e983e1bc49c74535e357e1e0670574
@Kevin Bracey Kevin Bracey authored on 19 Jun 2019
Showing 1 changed file
View
platform/mbed_atomic.h