- 412 名前:405 mailto:sage [2010/02/27(土) 19:19:17 ]
- >>406-411
みなさんありがとうございます。 template<class T, int N> int len(T (&)[N]){return N;} と #include <cstddef> template<typename T, std::size_t N> char (&lengthof_helper_char_array(T (&a)[N]))[N]; #define lengthof(a) (sizeof(lengthof_helper_char_array(a))) ですと、どちらが望ましいのでしょうか?
|

|