By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,778 Members | 1,947 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,778 IT Pros & Developers. It's quick & easy.

slice_array problem in vs2005

P: n/a
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<intval(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

Mar 20 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.