Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Using Boost Test VC143: Get <function-style-cast>': cannot convert from 'initializer list errors #2

Open
Smurf-IV opened this issue May 30, 2022 · 0 comments

Comments

@Smurf-IV
Copy link

Severity Code Description Project File Line Suppression State
Error C2440 '': cannot convert from 'initializer list' to 'evolutional::Chamois::detail::ThatStrImplstd::string' Boost_Tests Z:\Repos\MO_Legacy\LR_Licensing\LR_Licensing\Main-VS2022\Tests\Boost_Tests\Chamois.hpp 946
Z:\Repos\MO_Legacy\LR_Licensing\LR_Licensing\Main-VS2022\Tests\Boost_Tests\Chamois.hpp(946,1): message : No constructor could take the source type, or constructor overload resolution was ambiguous
Z:\Repos\MO_Legacy\LR_Licensing\LR_Licensing\Main-VS2022\Tests\Boost_Tests\Chamois.hpp(945): message : while compiling class template member function 'evolutional::Chamois::detail::ThatStrImplstd::string evolutional::Chamois::BasicAssertevolutional::Chamois::detail::AssertInternal::That(const std::string &)'

Z:\Repos\MO_Legacy\LR_Licensing\LR_Licensing\Main-VS2022\Tests\Boost_Tests\Boost_Tests.cpp(16): message : see reference to function template instantiation 'evolutional::Chamois::detail::ThatStrImplstd::string evolutional::Chamois::BasicAssertevolutional::Chamois::detail::AssertInternal::That(const std::string &)' being compiled

Z:\Repos\MO_Legacy\LR_Licensing\LR_Licensing\Main-VS2022\Tests\Boost_Tests\Boost_Tests.cpp(16): message : see reference to class template instantiation 'evolutional::Chamois::BasicAssertevolutional::Chamois::detail::AssertInternal' being compiled

for the following code:

#define BOOST_TEST_MODULE MyTest
#include <boost/test/unit_test.hpp>
#include <string>

#include "Chamois.hpp"


BOOST_AUTO_TEST_CASE( my_boost_test )
{
    std::string expected_value = "Bill";

    BOOST_CHECK( expected_value == expected_value );
    evolutional::Chamois::Assert::That( expected_value ).Should().Be( expected_value );
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant