Signed-off-by: Yao Zongyou <yaozongyou@vip.qq.com>
class CephContext;
-/* this is handy; can't believe it's not standard */
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*a))
-
typedef boost::variant<std::string,
bool,
int64_t,
*/
+#include <iterator>
#include <sstream>
#include <tuple>
#include <stdlib.h>
exited_quorum = ceph_clock_now();
// prepare local commands
- local_mon_commands.resize(ARRAY_SIZE(mon_commands));
- for (unsigned i = 0; i < ARRAY_SIZE(mon_commands); ++i) {
+ local_mon_commands.resize(std::size(mon_commands));
+ for (unsigned i = 0; i < std::size(mon_commands); ++i) {
local_mon_commands[i] = mon_commands[i];
}
MonCommand::encode_vector(local_mon_commands, local_mon_commands_bl);
#include <cctype>
#include <fstream>
#include <iostream>
+#include <iterator>
#include <unistd.h>
#include <sys/stat.h>
JSONFormatter *f = new JSONFormatter();
f->open_object_section("command_descriptions");
for (OSDCommand *cp = osd_commands;
- cp < &osd_commands[ARRAY_SIZE(osd_commands)]; cp++) {
+ cp < &osd_commands[std::size(osd_commands)]; cp++) {
ostringstream secname;
secname << "cmd" << setfill('0') << std::setw(3) << cmdnum;