АК
template<typename T>
std::ostream& operator<<(std::ostream& out, const Vector3D<T>& other)
{
out << "x := " << other.x;
}
Size: a a a
АК
template<typename T>
std::ostream& operator<<(std::ostream& out, const Vector3D<T>& other)
{
out << "x := " << other.x;
}
AS
F
AS
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,struct Vector3D<int> const &)" (??6@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV01@AEBU?$Vector3D@H@@@Z) referenced in function main D:\ASGraphic\out\build\x64-Debug\ASGraphic D:\ASGraphic\out\build\x64-Debug\main.cpp.obj 1
АК
AS
AS
АК
std::ostream& operator<<(std::ostream& out, const Vector3D<T>& other);
friend
AS
AS
AS
AS
AS
AS
AS
friend std::ostream& operator<< <T> (std::ostream& out, const Vector3D<T>&);
AS
VD
ДЖ
AS
VS
S<int>
ведет к неявной инстанциации декларации шаблона operator[]
на строке 13 (temp#inst-3.1). (2) далее вызов a[1]
должен разрешиться в пользу декларации, инстанцированной из шаблона на строке 13 (temp#inst-10) (*), (3) что ведет к неявной инстанциации уже определения operator[]
из того же шаблона (temp#inst-4), что (4) позволит компилятору вывести возвращаемый тип (dcl.spec.auto#general-12)return
, dedu
, definition
и placeholder
по главе [over]