Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: sky/engine/wtf/Vector.h

Issue 714393002: Remove support for MSVC (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 } 606 }
607 607
608 Vector(const Vector&); 608 Vector(const Vector&);
609 template<size_t otherCapacity> 609 template<size_t otherCapacity>
610 explicit Vector(const Vector<T, otherCapacity, Allocator>&); 610 explicit Vector(const Vector<T, otherCapacity, Allocator>&);
611 611
612 Vector& operator=(const Vector&); 612 Vector& operator=(const Vector&);
613 template<size_t otherCapacity> 613 template<size_t otherCapacity>
614 Vector& operator=(const Vector<T, otherCapacity, Allocator>&); 614 Vector& operator=(const Vector<T, otherCapacity, Allocator>&);
615 615
616 #if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
617 Vector(Vector&&); 616 Vector(Vector&&);
618 Vector& operator=(Vector&&); 617 Vector& operator=(Vector&&);
619 #endif
620 618
621 size_t size() const { return m_size; } 619 size_t size() const { return m_size; }
622 size_t capacity() const { return Base::capacity(); } 620 size_t capacity() const { return Base::capacity(); }
623 bool isEmpty() const { return !size(); } 621 bool isEmpty() const { return !size(); }
624 622
625 T& at(size_t i) 623 T& at(size_t i)
626 { 624 {
627 RELEASE_ASSERT(i < size()); 625 RELEASE_ASSERT(i < size());
628 return Base::buffer()[i]; 626 return Base::buffer()[i];
629 } 627 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 ASSERT(begin()); 787 ASSERT(begin());
790 } 788 }
791 789
792 std::copy(other.begin(), other.begin() + size(), begin()); 790 std::copy(other.begin(), other.begin() + size(), begin());
793 TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), e nd()); 791 TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), e nd());
794 m_size = other.size(); 792 m_size = other.size();
795 793
796 return *this; 794 return *this;
797 } 795 }
798 796
799 #if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
800 template<typename T, size_t inlineCapacity, typename Allocator> 797 template<typename T, size_t inlineCapacity, typename Allocator>
801 Vector<T, inlineCapacity, Allocator>::Vector(Vector<T, inlineCapacity, Alloc ator>&& other) 798 Vector<T, inlineCapacity, Allocator>::Vector(Vector<T, inlineCapacity, Alloc ator>&& other)
802 { 799 {
803 m_size = 0; 800 m_size = 0;
804 // It's a little weird to implement a move constructor using swap but th is way we 801 // It's a little weird to implement a move constructor using swap but th is way we
805 // don't have to add a move constructor to VectorBuffer. 802 // don't have to add a move constructor to VectorBuffer.
806 swap(other); 803 swap(other);
807 } 804 }
808 805
809 template<typename T, size_t inlineCapacity, typename Allocator> 806 template<typename T, size_t inlineCapacity, typename Allocator>
810 Vector<T, inlineCapacity, Allocator>& Vector<T, inlineCapacity, Allocator>:: operator=(Vector<T, inlineCapacity, Allocator>&& other) 807 Vector<T, inlineCapacity, Allocator>& Vector<T, inlineCapacity, Allocator>:: operator=(Vector<T, inlineCapacity, Allocator>&& other)
811 { 808 {
812 swap(other); 809 swap(other);
813 return *this; 810 return *this;
814 } 811 }
815 #endif
816 812
817 template<typename T, size_t inlineCapacity, typename Allocator> 813 template<typename T, size_t inlineCapacity, typename Allocator>
818 template<typename U> 814 template<typename U>
819 bool Vector<T, inlineCapacity, Allocator>::contains(const U& value) const 815 bool Vector<T, inlineCapacity, Allocator>::contains(const U& value) const
820 { 816 {
821 return find(value) != kNotFound; 817 return find(value) != kNotFound;
822 } 818 }
823 819
824 template<typename T, size_t inlineCapacity, typename Allocator> 820 template<typename T, size_t inlineCapacity, typename Allocator>
825 template<typename U> 821 template<typename U>
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 struct NeedsTracing<Vector<T, N> > { 1191 struct NeedsTracing<Vector<T, N> > {
1196 static const bool value = false; 1192 static const bool value = false;
1197 }; 1193 };
1198 #endif 1194 #endif
1199 1195
1200 } // namespace WTF 1196 } // namespace WTF
1201 1197
1202 using WTF::Vector; 1198 using WTF::Vector;
1203 1199
1204 #endif // WTF_Vector_h 1200 #endif // WTF_Vector_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698