1. all 매크로 관용구

#define all(v) (v).begin(), (v).end()


ex) sort(all(a));
a.erase(unique(all(a)), a.end());
b.insert(b.end(), all(a));

2. FOREACH 매크로

#define FOREACH(it, v) \
  for(__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)

ex) FOREACH(it, VectorString)
   cout << *it <<endl;



+ Recent posts