Skip to content

Class template argument deduction not working - cpp17 #596

@amutamil

Description

@amutamil
#include <iostream>
#include <vector>

template<typename T>
class Data {
public:
	Data(const T &t) {
	}
};
Data(const char *) -> Data<std::string> ;
Data(int)->Data<long> ;
int main() {
	Data d1{5};
}

the above code is not compiling, only if I change Data d1{5} ; to Data<int> d1{5} ; it is working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions