I wonder that is there a possible way to interate every element of a struct?
struct Request {
enum method { // (R)equest (M)ethod + <method name>
RMstatus,
RMnew,
RMkill,
RMenable,
RMdisable,
RMexit
} request_method;
enum type { // (R)equest (T)ype + <type name>
RTsync,
RTpush,
RTpull
} request_type;
std::string orig_path;
std::string dest_path;
int freq;
Request(method _method, type _type, std::string o_path, std::string d_path) :
request_method(_method), request_type(_type), orig_path(o_path), dest_path(d_path) {
}
friend std::ostream& operator<<(std::ostream& os, Request const& request) {
os << "method: " << request.request_method
<< " type: " << request.request_type
<< " orig_path: " << request.orig_path
<< " dest_path: " << request.dest_path;
return os;
}
};
how can i access each element by using a loop
any help would be thankful...