This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <int WIDTH, int HEIGHT> | |
class Matrix | |
{ | |
protected: | |
double m_data[WIDTH* HEIGHT]; | |
public: | |
Matrix(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
{ | |
public: | |
A(int i) | |
{ | |
printf("A constructor: %u\n", i); | |
} | |
}; | |
void const_func() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
{ | |
... | |
} | |
Object FuncThatReturnObject() | |
{ | |
Object o; | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WellBehavedFunctor : public unary_functor<int, bool> | |
{ | |
public: | |
bool operator()(int i) { return i < 3; } | |
} | |
std::vector<int> numbers; | |
// Prints the number of numbers in the numbers vector that are 3 or greater. | |
std::cout << std::count_if(numbers.begin(), numbers.end(), std::not1(WellBehavedFunctor())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class T> | |
struct Deleter | |
{ | |
void operator()(const T* ptr) const | |
{ | |
delete ptr; | |
} | |
}; | |
std::vector<int*> numbers; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <functional> | |
#include <vector> | |
class A | |
{ | |
int value; | |
public: | |
void Add(int num) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final void b(WrapperFIXED_A l1, WrapperFIXED_B l2, int l3) | |
{ | |
WrapperFIXED_C cWRAP = NULL; | |
if(l2 == null) | |
{ | |
// Roger wanted me to make sure that this cant happen if it does anyways | |
String checkIT = new String(l1.VALUE()) | |
if(checkIT == NULL) | |
{ | |
throw RuntimeException("CRTIAL ERROR! THIS CANNOT HAPPEN!!!!!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SensorBaseTest a = SensorBaseTest(5); | |
SensorBaseTest b = SensorBaseTest(7); | |
SensorAggregator _sensors = SensorAggregator((SensorBase*[]){&a, &b}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ClipEndAgainstPlane(Vector4D& a, Vector4D& b, int axis) | |
{ | |
std::cout << " ClipEndAgainstPane " << a << b << std::endl; | |
// Positive side | |
if (a[axis] > a[3]) | |
{ | |
double alpha = (a[3] - a[axis])/(b[axis] - a[axis]); | |
std::cout << " Clipping against positive " << alpha << std::endl; | |
for(int i = 0; i < 4; ++i) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdlib> // atoi | |
#include <iostream> | |
using namespace std; | |
void do_work( int C1, int C2, int C3 ) { | |
for ( int i = 0 ; i < 8 ; i += 1 ) { | |
cout << "S1 i:" << i << endl; | |
for ( int j = 0 ; j < 4 ; j += 1 ) { | |
cout << "S2 i:" << i << " j:" << j << endl; | |
for ( int k = 0 ; k < 2 ; k += 1 ) { |