X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FSetVector.h;h=a7fd408c854a743db3d320d4ac467fc305add151;hb=00552e3875ee5f382db6c98286a241a7d0efe1b8;hp=d2f7286c2596d66496ebc0018fc7e8865b9d61d8;hpb=de2fae4c7bfaedb95705b272015592895e05fd9c;p=oota-llvm.git diff --git a/include/llvm/ADT/SetVector.h b/include/llvm/ADT/SetVector.h index d2f7286c259..a7fd408c854 100644 --- a/include/llvm/ADT/SetVector.h +++ b/include/llvm/ADT/SetVector.h @@ -100,7 +100,7 @@ public: /// \brief Insert a new element into the SetVector. /// \returns true iff the element was inserted into the SetVector. bool insert(const value_type &X) { - bool result = set_.insert(X); + bool result = set_.insert(X).second; if (result) vector_.push_back(X); return result; @@ -110,7 +110,7 @@ public: template void insert(It Start, It End) { for (; Start != End; ++Start) - if (set_.insert(*Start)) + if (set_.insert(*Start).second) vector_.push_back(*Start); } @@ -170,7 +170,7 @@ public: vector_.pop_back(); } - T pop_back_val() { + T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() { T Ret = back(); pop_back(); return Ret; @@ -195,11 +195,10 @@ private: set_type &set_; public: - typedef typename UnaryPredicate::argument_type argument_type; - TestAndEraseFromSet(UnaryPredicate P, set_type &set_) : P(P), set_(set_) {} - bool operator()(argument_type Arg) { + template + bool operator()(const ArgumentT &Arg) { if (P(Arg)) { set_.erase(Arg); return true;