Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template< typename T > struct FixedVector
- {
- T * ptr;
- size_t count;
- typedef T value_type;
- FixedVector():ptr(0),count(0) {}
- ~FixedVector()
- {
- DeleteArr(ptr); // Error message appears here
- count=0;
- }
- // ...
- }
- template< typename T > inline void DeleteArr( T *& ptr )
- {
- delete[] ptr;
- ptr = NULL;
- }
- error: call to function 'DeleteArr' that is neither visible in the template definition nor found by argument-dependent lookup
- 'DeleteArr' should be declared prior to the call site or in an associated namespace of one of its arguments.
- template< typename T > inline void DeleteArr( T *& ptr );
- template< typename T > inline void DeleteArr( T *& ptr )
- {
- delete[] ptr;
- ptr = NULL;
- }
- template< typename T > struct FixedVector
- {
- T * ptr;
- size_t count;
- typedef T value_type;
- FixedVector():ptr(0),count(0) {}
- ~FixedVector()
- {
- DeleteArr(ptr); // Error message appears here
- count=0;
- }
- // ...
- }
Add Comment
Please, Sign In to add comment