History

reverse feature and unit test + example

Andrew Aday committed 3 years ago

Commit e7ef3c81 parent 7686e906 files · +122 −0Browse files

Showing the changes to src/core/chuck_oo.cpp (1 of 6 files). Show all

Unified · Split

src/core/chuck_oo.cpp+60−0
@@ -38,6 +38,7 @@ · 37 unmodified lines
38#include "chuck_errmsg.h"38#include "chuck_errmsg.h"
39#include "chuck_dl.h"39#include "chuck_dl.h"
40 40
41#include <algorithm>
41#include <iostream>42#include <iostream>
42#include <sstream>43#include <sstream>
43#include <iomanip>44#include <iomanip>
@@ -699,6 +700,18 @@ void Chuck_Array4::get_keys( std::vector<std::string> & keys ) · 655 unmodified lines
699 700
700 701
701 702
703//-----------------------------------------------------------------------------
704// name: reverse()
705// desc: reverses array in-place
706//-----------------------------------------------------------------------------
707void Chuck_Array4::reverse( )
708{
709 std::reverse(m_vector.begin(), m_vector.end());
710}
711
712
713
714
702//-----------------------------------------------------------------------------715//-----------------------------------------------------------------------------
703// name: back()716// name: back()
704// desc: ...717// desc: ...
@@ -1087,6 +1100,18 @@ void Chuck_Array8::get_keys( std::vector<std::string> & keys ) · 382 unmodified lines
1087 1100
1088 1101
1089 1102
1103//-----------------------------------------------------------------------------
1104// name: reverse()
1105// desc: reverses array in-place
1106//-----------------------------------------------------------------------------
1107void Chuck_Array8::reverse( )
1108{
1109 std::reverse(m_vector.begin(), m_vector.end());
1110}
1111
1112
1113
1114
1090//-----------------------------------------------------------------------------1115//-----------------------------------------------------------------------------
1091// name: back()1116// name: back()
1092// desc: ...1117// desc: ...
@@ -1436,6 +1461,18 @@ void Chuck_Array16::get_keys( std::vector<std::string> & keys ) · 343 unmodified lines
1436 1461
1437 1462
1438 1463
1464//-----------------------------------------------------------------------------
1465// name: reverse()
1466// desc: reverses array in-place
1467//-----------------------------------------------------------------------------
1468void Chuck_Array16::reverse( )
1469{
1470 std::reverse(m_vector.begin(), m_vector.end());
1471}
1472
1473
1474
1475
1439//-----------------------------------------------------------------------------1476//-----------------------------------------------------------------------------
1440// name: back()1477// name: back()
1441// desc: ...1478// desc: ...
@@ -1875,6 +1912,18 @@ void Chuck_Array24::get_keys( std::vector<std::string> & keys ) · 433 unmodified lines
1875 1912
1876 1913
1877 1914
1915//-----------------------------------------------------------------------------
1916// name: reverse()
1917// desc: reverses array in-place
1918//-----------------------------------------------------------------------------
1919void Chuck_Array24::reverse( )
1920{
1921 std::reverse(m_vector.begin(), m_vector.end());
1922}
1923
1924
1925
1926
1878//-----------------------------------------------------------------------------1927//-----------------------------------------------------------------------------
1879// name: Chuck_Array32()1928// name: Chuck_Array32()
1880// desc: constructor1929// desc: constructor
@@ -2211,6 +2260,17 @@ void Chuck_Array32::get_keys( std::vector<std::string> & keys ) · 330 unmodified lines
2211 2260
2212 2261
2213 2262
2263//-----------------------------------------------------------------------------
2264// name: reverse()
2265// desc: reverses array in-place
2266//-----------------------------------------------------------------------------
2267void Chuck_Array32::reverse( )
2268{
2269 std::reverse(m_vector.begin(), m_vector.end());
2270}
2271
2272
2273
2214 2274
2215// static2275// static
2216t_CKUINT Chuck_Event::our_can_wait = 0;2276t_CKUINT Chuck_Event::our_can_wait = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t