Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error C2039 with MSVC when using /std:c++latest (C++20) - std::is_literal_type removed #215

Open
pumkinpal opened this issue Feb 1, 2021 · 2 comments

Comments

@pumkinpal
Copy link

The following minimum sample fails to compile when using MSVC with /std:c++latest (C++20).
See: godbolt example

#include <vector>
#include <algorithm>
#include <boost/hof/proj.hpp>
#include <boost/hof/placeholders.hpp>

struct A
{
    int i;
    char c;
};

void foo(std::vector<A>& vec)
{
    using namespace boost::hof;
    std::sort(vec.begin(), vec.end(), proj(&A::i, _ < _));
}

The main issue is that HOF uses std::is_literal_type which was deprecated in C++17 and removed in C++20 and the Microsoft STL has removed it (link)

@pumkinpal pumkinpal changed the title Build Error C2039 with MSVC when using /std:c++latest (C++20) - std::is_literal_type removal Build Error C2039 with MSVC when using /std:c++latest (C++20) - std::is_literal_type removed Feb 1, 2021
@pfultz2
Copy link
Collaborator

pfultz2 commented Feb 1, 2021

So it looks like __is_literal_type intrinsic is still available, so I should use that instead.

@Tradias
Copy link

Tradias commented Apr 12, 2021

@pfultz2 any chance that this makes it into Boost 1.76.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants