Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jim_cox
Beginner
635 Views

?? error: no suitable copy constructor

Jump to solution

I'm trying to understand the following compiler error

1>OpsData\\PublicRoute.cpp(301): error: class "std::basic_ofstream" has no suitable copy constructor
1> list.Write( oFile ) ;

which would appear to stem from the definition

ofstream oFile ;

where ofstrem is defined in

If I check the function definition in nodelist.cpp

BOOL CPublicRouteNodeList::Write( ofstream oFile )

the ofstream definition also points back to the same definition in

I dont understand why the two defintions - which appear to be identical - wont work

What is trying to do here

I note thaat the code does compile with some other compilers

Any suggestioos?

advTHANKXance yet again

Jimmy

=mjc=

.


0 Kudos
1 Solution
Judith_W_Intel
Employee
635 Views

Instead of trying to copy the parameter by value, copy it by reference, i.e.:

BOOL CPublicRouteNodeList::Write( ofstream& oFile )

Judy

View solution in original post

2 Replies
Judith_W_Intel
Employee
636 Views

Instead of trying to copy the parameter by value, copy it by reference, i.e.:

BOOL CPublicRouteNodeList::Write( ofstream& oFile )

Judy

View solution in original post

jim_cox
Beginner
635 Views
Yup - that's it thankx.
Reply