Ambiguous calling the function using fstream C++

favorite


I have a class, class A, with a data member std::fstream file.

The class has a constructor that does not initialize the file.

I get a compiler error:

std:basic_fstream <_Elem, _Traits> ambiguous call to overloaded function.

this is the code:
1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include <fstream>   
#include <sstream>    
using namespace std;

class TextFile
{
 std::fstream myWinFile;
 TextFile() {}  
};


What can cause the error?


Where are you using this code?

Aceix.
That snippet compiles fine for me in Visual Studio.
Last edited on
> I get a compiler error:
> std:basic_fstream <_Elem, _Traits> ambiguous call to overloaded function.
you leave out the important part, post it full.


> this is the code:
no, it is not
Topic archived. No new replies allowed.