dimanche 31 juillet 2016

Possible msvc/intellisense bug with variadic template arguments

I am using VS2015 Update 3. The following piece of code gives an intellisense error on the lines in main(), however the code compiles and runs without error.

#include <iostream>
#include <tuple>

// Template parameter classes
template<class...> struct ComponentList {};   
template<class...> struct Filter {};
template<class...> struct FilterList {};

template<typename ATuple, typename BTuple>
class EntityManager;

template<class... A, template<class> class... B>
class EntityManager<ComponentList<A...>, FilterList<B...>>
{
public:
    template<class A>
    void test()
    {
        std::cout << typeid(A).name() << std::endl;
    }

    // Create tuple for each filter inside filterlist
    std::tuple<B...> tuples;
};

using MyComponents = ComponentList<int, double, float>;
using FirstFilter = Filter<int, double>;
using SecondFilter = Filter<float>;
using MyFilters = FilterList<FirstFilter, SecondFilter>;

void main()
{
    EntityManager<MyComponents, MyFilters> em;
    em.test<int>();
}

On the first line of main, intellisense says 'incomplete type is not allowed'.

On the second line, intellisense gives three errors: 'incomplete type is not allowed', 'type name is not allowed', and 'expected an expression'

Is this a bug in the compiler or in intellisense?

Aucun commentaire:

Enregistrer un commentaire