We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
应该这样实现才行:
template <typename T, size_t N> inline T* _begin(T (&a)[N]) { // cout << "begin" << endl; return a; } template <typename T, size_t N> inline const T* _begin(const T (&a)[N]) { // cout << "cbegin" << endl; return a; } template <typename T, size_t N> inline T* _end(T (&a)[N]) { // cout << "end" << endl; return a + N; } template <typename T, size_t N> inline const T* _end(const T (&a)[N]) { // cout << "cend" << endl; return a + N; }
The text was updated successfully, but these errors were encountered:
const 在这里有点多余,在这里,T 涵盖了 const T。
const
T
const T
见:http://stackoverflow.com/questions/9679116/is-there-any-difference-between-t-and-const-t-in-template-parameter
Sorry, something went wrong.
No branches or pull requests
应该这样实现才行:
The text was updated successfully, but these errors were encountered: