Skip to content

Conversation

@melak47
Copy link
Contributor

@melak47 melak47 commented Oct 30, 2020

I started out trying to fix #22 and noticed there are also other, undesirable conversions that are currently allowed (see #23).

This PR is my attempt at fixing both,
by adding SFINAE constraints (and a few non-template iterator/pointer overloads) to the constructors.

I also added these constraints to the try_init factory functions where applicable,
though they could conceivably be replaced with static_asserts there.

I tried to keep the formatting consistent when I had to spread the enable_if conditions over multiple lines,
I'm not sure if I succeeded everywhere.

* to prevent ambiguities during overload resolution
* to disable the constructor if the source's value type is
incompatible
@lamarrr
Copy link
Owner

lamarrr commented Nov 8, 2020

LGTM.
Thanks for the fix. I'll make additional changes later if need be.

@lamarrr lamarrr merged commit 7832576 into lamarrr:master Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants