inline std::string key_qvalue_pairs(std::initializer_list<kv_pair> pairs)
{
    return key_qvalue_pairs(array_view<kv_pair>{pairs.begin(), pairs.end()});
}
Beispiel #2
0
Value Object::callAsFunction(const Object& thisObj, std::initializer_list<JSValueRef> args) const {
  return callAsFunction((JSObjectRef)thisObj, args.size(), args.begin());
}
Beispiel #3
0
 constexpr
 ranges::reverse_iterator<T const*> operator()(std::initializer_list<T> il) const noexcept
 {
     return ranges::reverse_iterator<T const*>(il.begin());
 }
Beispiel #4
0
inline bool in(std::initializer_list<file_type> types, file_type value) {
    return find(types.begin(), types.end(), value) != types.end();
}
 void add(std::initializer_list<AssemblyStage*> stages) {
     for (auto it = stages.begin(), et = stages.end(); it != et; ++it)
         add(*it);
 }
Beispiel #6
0
inline lstring::lstring(std::initializer_list<string> list) {
  for(const string *s = list.begin(); s != list.end(); ++s) {
    operator<<(*s);
  }
}
Beispiel #7
0
 //! <b>Effects</b>: Constructs an empty set using the specified
 //! allocator, and inserts elements from the range [il.begin(), il.end()).
 //!
 //! <b>Complexity</b>: Linear in N if the range [il.begin(), il.end()) is already sorted using
 //! comp and otherwise N logN, where N is il.begin() - il.end().
 set(std::initializer_list<value_type> il, const allocator_type& a)
     : base_t(true, il.begin(), il.end(), Compare(), a)
 {}
Beispiel #8
0
	void Assign(std::initializer_list<Char> rhs) noexcept {
		Assign(rhs.begin(), rhs.end());
	}
Beispiel #9
0
 inline Heap<T, Compare>::Heap(std::initializer_list<T> list):
   Heap<T, Compare>(list.begin(), list.end())
 {}
Beispiel #10
0
	// initializer_list constuctor
	segmented_map(std::initializer_list<value_type> il) : segmented_map{il.begin(), il.end()} {}
Beispiel #11
0
	constexpr StringObserver(std::initializer_list<Char> rhs) noexcept
		: StringObserver(rhs.begin(), rhs.size())
	{
	}
Beispiel #12
0
		explicit Polygon(std::initializer_list<Vec2> outer)
			: Polygon(outer.begin(), outer.size()) {}
 Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
     { TEST_THROW(6);}
 constexpr Y(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) {}
Beispiel #15
0
	flat_map(
		std::initializer_list<value_type> init,
		CompareF const &comp = CompareF(),
		Alloc const &a = Alloc()
	) : flat_map(init.begin(), init.end(), comp, a)
	{}
Beispiel #16
0
static void
test_insertion_erasure_and_searching() {

  map<int, int> m;
  const auto& cb = m;

  std::map<int, int> sm;
  const auto& csm = sm;

  int i = 0;

  for (const auto& x : il) {

    if (i++ & 2)
      m.insert(x);
    else
      m[x.first] = x.second;

    sm.insert(x);

    test_equality(m, sm);
    test_copying(m);

    test_searching(m .lower_bound(1), m .end(), sm .lower_bound(1), sm .end());
    test_searching(m .lower_bound(2), m .end(), sm .lower_bound(2), sm .end());

    test_searching(cb.lower_bound(1), cb.end(), csm.lower_bound(1), csm.end());
    test_searching(cb.lower_bound(2), cb.end(), csm.lower_bound(2), csm.end());

    test_searching(m .upper_bound(1), m .end(), sm .upper_bound(1), sm .end());
    test_searching(m .upper_bound(2), m .end(), sm .upper_bound(2), sm .end());

    test_searching(cb.upper_bound(1), cb.end(), csm.upper_bound(1), csm.end());
    test_searching(cb.upper_bound(2), cb.end(), csm.upper_bound(2), csm.end());

    test_searching(m .find(1), m .end(), sm .find(1), sm .end());
    test_searching(m .find(2), m .end(), sm .find(2), sm .end());

    test_searching(cb.find(1), cb.end(), csm.find(1), csm.end());
    test_searching(cb.find(2), cb.end(), csm.find(2), csm.end());
  }

  for (const auto& x : il) {

    auto im  =  m.find(x.first);
    auto ism = sm.find(x.first);

    assert((im == m.end()) == (ism == sm.end()));

    if (im != m.end()) {
      im  =  m.erase(im);
      ism = sm.erase(ism);
    }

    assert((im == m.end()) == (ism == sm.end()));
    assert(im == m.end() || *im == *ism);
  }

  m.insert(il.begin(), il.end());
  sm = il;
  test_equality(m, sm);

  assert(m.erase(m.begin(), m.end()) == m.end());
  test_emptiness(m);

  m = il;
  auto it = --m.end();
  assert(m.erase(++m.begin(), it) == it);

  sm = il;
  sm.erase(++sm.begin(), --sm.end());

  test_equality(m, sm);
}
Beispiel #17
0
int_vector::int_vector(std::initializer_list<value_type> ilist)
    : int_vector(static_cast<size_type>(ilist.size()), needed_bits(ilist)) {

  std::copy(ilist.begin(), ilist.end(), begin());
}
Beispiel #18
0
 array_view(const std::initializer_list<T>& l)
     : size_(l.size()), data_(l.begin()) {}
Beispiel #19
0
PLOTLIB_INLINE PMat::PMat( const std::initializer_list< std::initializer_list< double > > &data )
    : mData( data.begin(), data.end() )
{
    mDimension = CheckDimensions( mData );
}
Beispiel #20
0
Vector::Vector(const std::initializer_list<GLfloat>& coordArray)
{
	for (std::initializer_list<GLfloat>::const_iterator it = coordArray.begin(); it != coordArray.end(); ++it) {
		coords.push_back(*it);
	}
}
Beispiel #21
0
 //! <b>Effects</b>: Constructs an empty set using the specified comparison object and
 //! allocator, and inserts elements from the ordered unique range [il.begin(), il.end()). This function
 //! is more efficient than the normal range creation for ordered ranges.
 //!
 //! <b>Requires</b>: [il.begin(), il.end()) must be ordered according to the predicate and must be
 //! unique values.
 //!
 //! <b>Complexity</b>: Linear in N.
 //!
 //! <b>Note</b>: Non-standard extension.
 set( ordered_unique_range_t, std::initializer_list<value_type> il, const Compare& comp = Compare()
         , const allocator_type& a = allocator_type())
     : base_t(ordered_range, il.begin(), il.end(), comp, a)
 {}
Beispiel #22
0
 GLSLStrings(const std::initializer_list<const GLchar*>& l)
   : _count(GLsizei(l.size()))
   , _strs(l.begin())
   , _lens(nullptr) {
 }
Beispiel #23
0
void NPC::assignDialog(const std::initializer_list<std::string> &dialog) {
	mDialog.assign(dialog.begin(), dialog.end());
}
Beispiel #24
0
 Geom (std::initializer_list <Attrib> attribs, uint index_buffer, uint index_count, uint index_type) :
   Geom (attribs.begin (), attribs.size (), index_buffer, index_count, index_type)
 { }
Beispiel #25
0
Value Object::callAsFunction(std::initializer_list<JSValueRef> args) const {
  return callAsFunction(nullptr, args.size(), args.begin());
}
 BoVector(const std::initializer_list<int>& v) {
    for (std::initializer_list<int>::iterator itr = v.begin(); itr!=v.end(); ++ itr)
       m_vec.push_back(*itr);
 }
Beispiel #27
0
/*
	Braced initialization
	You use this for creating a polynomial with specific degree coefficients. Solves requirement 1b,
		as well as the braced initializer support from requirement 5.
*/
template <typename C> Polynomial<C>::Polynomial(std::initializer_list<C> list) : pImpl(std::make_unique<Polynomial<C>::PolynomialData>())
{
	this->SetCoefficientRange<std::initializer_list<C>>(list.begin(), list.end());
}
Beispiel #28
0
	void insert(std::initializer_list<value_type> init)
	{
		insert(init.begin(), init.end());
	}
Beispiel #29
0
	inline tmatnm(std::initializer_list<S> list) {
		auto il = list.begin();
		for(int i = 0; i < N*N && il != list.end(); ++i, ++il) {
				data[i] = static_cast<T>(*il);
		}
	}
Beispiel #30
0
 array_view_const_char assign(charp_or_string type, std::initializer_list<kv_pair> pairs)
 {
     return this->assign(type, array_view<kv_pair>{pairs.begin(), pairs.end()});
 }