Skip to content

id2type_impl specialization before declaration fails to compile in MSVC with /permissive- flag #9

@mathcounts4

Description

@mathcounts4

See the compilation failure on godbolt

The full specialization of id2type_impl in the full template definition of msvc_extract_type is the problem, and can easily be solved by swapping the order (full declaration before specialization definition).

If that link is stale, go to godbolt + msvc + add flag "/permissive-" (without quotes), and paste the code below (wish we could use boost + MSVC on godbolt):

template<typename ID, typename T>
struct msvc_extract_type {
    template<>
    struct id2type_impl<true> { // VC8.0 specific bug-feature.
        typedef T type;
    };

    template<bool>
    struct id2type_impl;

    typedef id2type_impl<true> id2type;
};

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