python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How do I make C++ friend template specializations work?
I have a class that overloads the bit shift operator like the following:
template<typename DataType>
friend Packet& operator << (Packet& pkt, const DataType& data)
...
noob-cryptor
Votes: 0
Answers: 2
Downcast trait to generic type
I have the following 2 traits: Org, Capability.
#![feature(specialization)]
trait Org {}
struct OrgV1 {}
impl Org for OrgV1 {...}
struct OrgV2 {}
impl Org for OrgV2 {...}
trait Capability {}
str...
Aibek
Votes: 0
Answers: 1
How linker allow multiple definitions of a function template in different object files but only allow one-definition of ordinary functions
I know how to use inline keyword to avoid 'multiple definition' while using C++ template. However, what I am curious is that how linker is distinguishing which specialization is full specialization an...
Tony Su
Votes: 0
Answers: 1
Can a recursive/self-referential template (using pointers) be instantiated and/or specialized in C++?
I want to instantiate a template from the STL, using maps,vectors, and arrays, as follows:
map<some_type,vector<map<some_type,vector...>*>> elements;
The ellipses is just pseudo-co...
mo FEAR
Votes: 0
Answers: 1