prog.cpp: In function 'int main()':
prog.cpp:18:12: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
buf[ 0 ]; // Generates an error
^
prog.cpp:10:15: note: candidate 1: T& buffer<T>::operator[](size_t) [with T = int; size_t = unsigned int]
T & operator [] ( size_t );
^
prog.cpp:18:12: note: candidate 2: operator[](int*, int) <built-in>
buf[ 0 ]; // Generates an error
^
prog.cpp:18:12: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
prog.cpp:10:15: note: candidate 1: T& buffer<T>::operator[](size_t) [with T = int; size_t = unsigned int]
T & operator [] ( size_t );
^
prog.cpp:18:12: note: candidate 2: operator[](const int*, int) <built-in>
buf[ 0 ]; // Generates an error
^
/home/ntCEfH/cc1Sg4bI.o: In function `main':
prog.cpp:(.text.startup+0x24): undefined reference to `buffer<int>::operator[](unsigned int)'
collect2: error: ld returned 1 exit status