When trying to use the following code:
Code:
template<class T>
class StreamSource
{
T source;
public:
StreamSource() : source()
{
}
const T& getSource()
{
return source;
}
template<class Y>
VideoStream<T, Y> operator>>(Y* nextObject)
{
return VideoStream<T, Y>(this, nextObject);
}
};
Gives me the following compiler output:
Code:
VideoStream.h(44) : error C2665: 'VideoStream<T,Y>::VideoStream' : none of the 3
overloads could convert all the argument types
1> with
1> [
1> T=Source,
1> Y=Etc
1> ]
k:\felipe\projects\scarvideo\scarvideo\VideoStream.h(14): could be 'VideoStream<T,Y>::VideoStream(T *,Y *)'
1> with
1> [
1> T=Source,
1> Y=Etc
1> ]
while trying to match the argument list '(StreamSource<T> *const , Etc *)'
1> with
1> [
1> T=Source
1> ]
.\main.cpp(47) : see reference to function template instantiation 'VideoStream<T,Y>
StreamSource<T>::operator >><Etc>(Y *)' being compiled
1> with
1> [
1> T=Source,
1> Y=Etc
1> ]
All i wanted to do is to create the object VideoStream with the first type the same of the VideoSource::source type and the second type of the type provided by the operator>>. What´s wrong?