H
holmescn
Hi-
Anyone here used vs2005?So I appreciate your help.
I used stlport 5.0. When I complied the code below,an error occured:
#include<valarray>
using namespace std;
main()
{
valarray<int> val(10);
slice_array<int>& v0=val[slice(0,5,2)]; ///aaa
const slice_array<int>& v1=val[slice(0,5,2)]///bbb
}
there aaa and bbb both occured an compiling error:
error C2248: 'stlp_std::slice_array<_Tp>::slice_array' : cannot access
private member declared in class 'stlp_std::slice_array<_Tp>'
I know that slice_array can't be constructed,but why a reference is
also error?
aaa is an example in Stroustrup TC++PL 3rd special edition
bbb is some help i found in the past information in 2001,but they used
gcc.
finally i found some solution in MSDN. They used val[slice] directly.I
have tryed it .And it works well.
But i still want to know why this problem happened.
Look forward to your answers.
Thx
Anyone here used vs2005?So I appreciate your help.
I used stlport 5.0. When I complied the code below,an error occured:
#include<valarray>
using namespace std;
main()
{
valarray<int> val(10);
slice_array<int>& v0=val[slice(0,5,2)]; ///aaa
const slice_array<int>& v1=val[slice(0,5,2)]///bbb
}
there aaa and bbb both occured an compiling error:
error C2248: 'stlp_std::slice_array<_Tp>::slice_array' : cannot access
private member declared in class 'stlp_std::slice_array<_Tp>'
I know that slice_array can't be constructed,but why a reference is
also error?
aaa is an example in Stroustrup TC++PL 3rd special edition
bbb is some help i found in the past information in 2001,but they used
gcc.
finally i found some solution in MSDN. They used val[slice] directly.I
have tryed it .And it works well.
But i still want to know why this problem happened.
Look forward to your answers.
Thx