Home | History | Annotate | Download | only in priqueue.members
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <queue>
     11 
     12 // priority_queue();
     13 
     14 // template <class... Args> void emplace(Args&&... args);
     15 
     16 #include <queue>
     17 #include <cassert>
     18 
     19 #include "../../../Emplaceable.h"
     20 
     21 int main()
     22 {
     23 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     24     std::priority_queue<Emplaceable> q;
     25     q.emplace(1, 2.5);
     26     assert(q.top() == Emplaceable(1, 2.5));
     27     q.emplace(3, 4.5);
     28     assert(q.top() == Emplaceable(3, 4.5));
     29     q.emplace(2, 3.5);
     30     assert(q.top() == Emplaceable(3, 4.5));
     31 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     32 }
     33