Skip to content

boost::safe_numerics::safe<...> is convertible to std::string? #141

Description

@usefulcat

Is it intentional that the following code does not produce an error when compiled?

#include <boost/safe_numerics/safe_integer.hpp>
#include <type_traits>
#include <string>

static_assert(std::is_convertible_v<boost::safe_numerics::safe<int>, std::string>);

It seems wrong, but maybe there is a reason for it?

I'm trying to track down a (to me) relatively obscure problem elsewhere, and I think this may be at least related to, if not the cause of the problems I'm seeing. I checked the two most recent versions of clang and gcc and got the same behavior in all cases.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions