slice_array problem in vs2005

Discussion in 'C++' started by holmescn, Mar 20, 2007.

  1. holmescn

    holmescn Guest

    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
    holmescn, Mar 20, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Han

    VS2005, Port problem

    Han, Jul 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    429
  2. steffo

    control size problem vs2005

    steffo, Mar 11, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    348
    steffo
    Mar 11, 2005
  3. Felix González
    Replies:
    1
    Views:
    416
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 10, 2005
  4. Miguel Dias Moura

    Problem with images in VS2005

    Miguel Dias Moura, Dec 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    425
    Daniel TIZON
    Dec 16, 2005
  5. Chris Forone

    valarray/slice_array

    Chris Forone, Jun 13, 2008, in forum: C++
    Replies:
    2
    Views:
    426
Loading...

Share This Page