0

I have the function definition bellow:

  template <class KEY, class VALUE>
  inline
  SortedPairsVector<KEY, VALUE>::value_type& 
  SortedPairsVector<KEY, VALUE>::operator[](int index) //Error Here
  {
      return d_data[index].data();
  }

The following error occurs on the line indicated:

  error: expected initializer before 'SortedPairsVector'

I'm sure the answer is really simple, but I'm new to C++ and I can't seem to spot it. What is causing the error?

0

1 Answer 1

1

Use

typename SortedPairsVector<KEY, VALUE>::value_type&

instead of

SortedPairsVector<KEY, VALUE>::value_type&

Not the answer you're looking for? Browse other questions tagged or ask your own question.