some stuff about C++and development
sequence points5.1.2.3 Program execution. Clause 2At certain specified points in theexecution sequence calledsequence point...
sequence pointsprogram stateside effectstime
sequence pointsprogram stateside effectstime
sequence pointsprogram stateside effectstime
sequence pointsprogram stateside effectstime
sequence pointsprogram stateside effectstime
sequence pointsprogram stateside effectstime
sequence pointsprogram stateside effectstime
sequence pointsprogram stateside effectstime
sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a ...
sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a ...
sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a ...
sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a ...
sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a ...
sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a ...
sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a ...
sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a ...
sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a ...
sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a ...
sequence pointsIn reality C and C++ havevery few sequence points(this is to give maximumscope for optimization).
sequence points where?• at the end of a full expression• after the first operand of these operators&& || ?: ,• after evalua...
onlysequence pointsgovern the order ofevaluation
got it?
sequence pointsi = v[++i] + v[++i];question: where are thesequence pointsin this statement ?
sequence pointsi = v[++i] + v[++i];answer: here!
why doesthis matter?
Im gladyou asked!
hereswhy...
shallIf a "shall" or a "shall not" requirementthat appears outside of a constraint isviolated, the behavior is undefined.4....
sequence point: rule-oneBetween the previous and nextsequence point an object shall have itsstored value modified at most o...
sequence point: rule-oneBetween the previous and nextsequence point an object shall have itsstored value modified at most o...
sequence point: rule-twoBetween the previous and nextsequence point the prior value shall beread only to determine the val...
sequence point: rule-twoBetween the previous and nextsequence point the prior value shall beread only to determine the val...
example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ ...
example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ ...
example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ ...
example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ ...
example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ ...
example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ ...
a reference toa[i]can also be written as*(a+i)5.3 Pointers and Arrays
example#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    dst[i] =...
example#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    dst[i] =...
example#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    dst[i] =...
example#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    dst[i] =...
example#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    dst[i] =...
precedence is not thesame as order ofevaluation
order of evaluation ismostly unspecifiedand is arun-time thing
precedence iscompletely specifiedand is acompile-time thing
precedence determineswhich operandsbind towhich operators
a * b + cexample
a * b + c?
a * b + c?
a() * b() + c()
temp_a = a();temp_b = b();temp_c = c();a * b + c
temp_c = c();temp_b = b();temp_a = a();a * b + c
temp_b = b();temp_c = c();temp_a = a();a * b + c
example#include <iostream>...int main(){int sum = a() + b();std::cout << sum;}#include <iostream>...int a(){std::cout << "...
example#include <iostream>...int main(){int sum = a() + b();std::cout << sum;}$ g++ *.c && ./a.out#include <iostream>...in...
example#include <iostream>...int main(){int sum = a() + b();std::cout << sum;}$ g++ *.c && ./a.out#include <iostream>...in...
example#include <iostream>...int main(){int sum = a() + b();std::cout << sum;}$ g++ *.c && ./a.out $ g++ *.c && ./a.out#in...
example#include <iostream>...int main(){int sum = a() + b();std::cout << sum;}$ g++ *.c && ./a.out $ g++ *.c && ./a.out#in...
indeterminate value6.2.4 Storage duration of objectsThe initial value of the object isindeterminate.J.2 Undefined behaviorT...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo...
why do cars have brakes?
so you can drive faster!
do you do unittesting?
what do you meanby the wordunit ?
its nothing to dowith size
Atests
AtestsB
AtestsCB
AtestsCBD
AtestsCBDE
AtestsCBFDE
AtestsCBFGDE
AtestsCBFGDEexternal boundary
AtestsCBFGDdatabaseexternal boundary
AtestsCBFregistryDdatabaseexternal boundary
AtestsCBFregistryDfile systemexternal boundary
AtestsCBFsocketDfile systemexternal boundary
AtestsCBFsocketDfile systemexternal boundaryunit tests should pass or fail basedsolely on the correctness of our testsand o...
AtestsCBFsocketDfile systemexternal boundarynot based on the correctness ofexternal code and its environment
this means we haveto design "seams"into ourarchitecture
AtestsCBFsocketDfile systemsubstitutefile systemsubstitutesocketseamseam
this is ausefuldefinition
it meansunit testsare...
so fast, your basicdevelopmentactivity can changefrom...
re-compiling
to...
re-runningthe unit tests
this is not a merequantitativechange
it is aqualitativechange
some more about tests being...
void example_of_use(){q = snafu::instance().query(...)...snafu::instance().modifier(...);...}spot the anti-pattern
class snafu{public: // singletonstatic snafu & instance();public: // apiint query(...) const;void modifier(...);private: /...
this is the only good singleton
AtestsCBFsocketDfile systemsubstitutefile systemsubstitutesocketseamseam1singleton
AunittestCBFD1danger
AunittestCBFD1anotherunittestdanger
you should beable to run yourunit tests inany order
you should beable to run yourunit tests inparallel
unit testsintegrationsystemno externaldependenciessome externaldependenciesall externaldependencies
waterfallanalysisdesignimplementtest
waterfallanalysisdesignimplementdebug
Debugging is twice as hard aswriting the code in the firstplace. Therefore, if you writethe code as cleverly as possible,y...
"agile".........test.........test.........test
virtual destructor?class dice_roller{public:virtual ~dice_roller();...virtual int roll_dice() const = 0;};question:what do...
virtual destructorclass random_dice_roller: publicdice_roller{public:...};answer:any code can delete a derived objectthrou...
virtual destructorclass random_dice_roller: publicdice_roller{public:...};answer:any code can delete a derived objectthrou...
virtual destructor?class random_dice_roller: publicdice_roller{public:...};question:should any code be able to writedelete...
virtual destructorsuppose you dont want arbitrary code tobe able to write delete expressions?void contrived_example(){dice...
bad inheritancealphabetagammadeltanew alpha()new beta()new gamma()new delta()
good inheritancealpha beta gammaabstractiondeltaclient
factory patternabstractfactoryabstractproductconcreteproductconcretefactory<<creates>><<creates>>client
#include header#include "wibble.hpp"class fubar{};
inheritance#include "wibble.hpp"class fubar : public wibble // 1{};
member function parameters#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void re...
member function return types#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ...
data members#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wi...
static data member#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parame...
forward declarationclass wibble;class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wib...
which of 1..13 require #include ?#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2...
my assistant willnow collect up theanswers
the answer is...class wibble;class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble...
well see how you alldid shortly!
#include in .hpp .cpp#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"#include "snafu.hpp"#include "widget...
#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class snafu;class widget;class fubar{...};#endif#include ...
how much does a #include cost?#include <string>includer.cpp$ g++ -H includer.cpp &> lines$ wc -l lines
how much does a #include cost?#include <string>includer.cpp$ g++ -H includer.cpp &> lines$ wc -l lines. /usr/include/c++/4...
how much does a #include cost?#include <string>includer.cpp$ g++ -H includer.cpp &> lines$ wc -l lines. /usr/include/c++/4...
you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class snafu;class widget;class fub...
you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"namespace fishing{class snafu;clas...
you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"namespace std{class string;}class ...
you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"namespace std{class string;}class ...
you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"namespace std{template<typename T>...
you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"namespace std{template<typename T>...
dont forward declareanything in std::
template#ifndef SNAFU_INCLUDED#define SNAFU_INCLUDED#include <algorithm>...template<typename T>class snafu{public:void res...
template#ifndef SNAFU_INCLUDED#define SNAFU_INCLUDED...template<typename T>class snafu{public:void reserve(int limit);...}...
inline#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include <vector>class fubar{public:typedef std::vector<int>::iterator i...
template#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED...class fubar{public:template<typename iterator>void algo(iterator fr...
does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class fubar{public:...void fu();...priv...
does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class fubar{public:...void fu();...priv...
does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class fubar{public:...void fu();...priv...
does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class fubar{public:...void fu();...priv...
#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class fubar{public:...void fu();...private:std::vector<wi...
does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"#include <vector>class fubar{public:......
does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"#include <vector>class fubar{public:......
include your own header 1st#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"#include <vector>class fubar{p...
better still - make sure eachheader compiles (on its own) aspart of the build!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED...
rememberthis...
#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble &); // ...
the answer is...#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_paramete...
how did youall do?
over to myassistant...
the Satir change curveold status quonew status quo old status quoforeign elementresistanceandchaos integrationandpracticet...
@JonJaggerjon@jaggersoft.com
Some stuff about C++ and development
Some stuff about C++ and development
Some stuff about C++ and development
Some stuff about C++ and development
Some stuff about C++ and development
Some stuff about C++ and development
Some stuff about C++ and development
Some stuff about C++ and development
Upcoming SlideShare
Loading in …5
×

Some stuff about C++ and development

2,583 views

Published on

A talk I first gave at Amadeus in Nice, 18th April 2013.
Includes the #include test.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,583
On SlideShare
0
From Embeds
0
Number of Embeds
1,936
Actions
Shares
0
Downloads
29
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Some stuff about C++ and development

  1. 1. some stuff about C++and development
  2. 2. sequence points5.1.2.3 Program execution. Clause 2At certain specified points in theexecution sequence calledsequence points, all side effects ofprevious evaluations shall becomplete and no side effects ofsubsequent evaluation shall havetaken place.
  3. 3. sequence pointsprogram stateside effectstime
  4. 4. sequence pointsprogram stateside effectstime
  5. 5. sequence pointsprogram stateside effectstime
  6. 6. sequence pointsprogram stateside effectstime
  7. 7. sequence pointsprogram stateside effectstime
  8. 8. sequence pointsprogram stateside effectstime
  9. 9. sequence pointsprogram stateside effectstime
  10. 10. sequence pointsprogram stateside effectstime
  11. 11. sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a mostly left-to-right order.i + v[++i] + v[++i]
  12. 12. sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a mostly left-to-right order.i + v[++i] + v[++i]
  13. 13. sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a mostly left-to-right order.i + v[++i] + v[++i]
  14. 14. sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a mostly left-to-right order.i + v[++i] + v[++i]
  15. 15. sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a mostly left-to-right order.i + v[++i] + v[++i]
  16. 16. sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a mostly left-to-right order.i + v[++i] + v[++i]
  17. 17. sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a mostly left-to-right order.i + v[++i] + v[++i]
  18. 18. sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a mostly left-to-right order.i + v[++i] + v[++i]
  19. 19. sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a mostly left-to-right order.i + v[++i] + v[++i]
  20. 20. sequence pointsMost C and C++ programmers use an implicitmental model made up of lots of sequence points,progressing in a mostly left-to-right order.i + v[++i] + v[++i]
  21. 21. sequence pointsIn reality C and C++ havevery few sequence points(this is to give maximumscope for optimization).
  22. 22. sequence points where?• at the end of a full expression• after the first operand of these operators&& || ?: ,• after evaluation of all arguments andthe function call expression in afunction call
  23. 23. onlysequence pointsgovern the order ofevaluation
  24. 24. got it?
  25. 25. sequence pointsi = v[++i] + v[++i];question: where are thesequence pointsin this statement ?
  26. 26. sequence pointsi = v[++i] + v[++i];answer: here!
  27. 27. why doesthis matter?
  28. 28. Im gladyou asked!
  29. 29. hereswhy...
  30. 30. shallIf a "shall" or a "shall not" requirementthat appears outside of a constraint isviolated, the behavior is undefined.4. Conformance. Clause 2undefined behavior:behavior ... for which this InternationalStandard imposes no requirements.3.Terms, definitions, and symbols
  31. 31. sequence point: rule-oneBetween the previous and nextsequence point an object shall have itsstored value modified at most once bythe evaluation of an expression.n = n++;6.5 Expressions. Clause 2.undefined behavior
  32. 32. sequence point: rule-oneBetween the previous and nextsequence point an object shall have itsstored value modified at most once bythe evaluation of an expression.n = n++;6.5 Expressions. Clause 2.undefined behavior
  33. 33. sequence point: rule-twoBetween the previous and nextsequence point the prior value shall beread only to determine the value to bestored.n + n++;6.5 Expressions. Clause 2.undefined behavior
  34. 34. sequence point: rule-twoBetween the previous and nextsequence point the prior value shall beread only to determine the value to bestored.n + n++;6.5 Expressions. Clause 2.undefined behavior
  35. 35. example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ gcc foo.c && ./a.outgcc(Mac OS 10.8.2)http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  36. 36. example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ gcc foo.c && ./a.outgcc(Mac OS 10.8.2)$ gcc foo.c && ./a.out12http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  37. 37. example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ gcc foo.c && ./a.outgcc$ clang foo.c && ./a.outclang(Mac OS 10.8.2)$ gcc foo.c && ./a.out12http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  38. 38. example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ gcc foo.c && ./a.outgcc$ clang foo.c && ./a.outclang(Mac OS 10.8.2)$ gcc foo.c && ./a.out12$ clang foo.c && ./a.out11http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  39. 39. example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ gcc foo.c && ./a.outgcc$ clang foo.c && ./a.outclang$ icc foo.c && ./a.outicc(Mac OS 10.8.2)$ gcc foo.c && ./a.out12$ clang foo.c && ./a.out11http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  40. 40. example#include <stdio.h>int main(void){int v[] = { 0,2,4,6,8 };int i = 1;int n = i + v[++i] + v[++i];printf("%dn", n);}$ gcc foo.c && ./a.outgcc$ clang foo.c && ./a.outclang$ icc foo.c && ./a.outicc(Mac OS 10.8.2)$ gcc foo.c && ./a.out12$ clang foo.c && ./a.out11$ icc foo.c && ./a.out13http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  41. 41. a reference toa[i]can also be written as*(a+i)5.3 Pointers and Arrays
  42. 42. example#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    dst[i] = src[i++];    printf("%d %d %d %dn",dst[0], dst[1],dst[2], dst[3]);}$ gcc *.c && ./a.outgcc 4.8.0 20130210
  43. 43. example#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    dst[i] = src[i++];    printf("%d %d %d %dn",dst[0], dst[1],dst[2], dst[3]);}$ gcc *.c && ./a.out$ gcc *.c && ./a.out0 2 0 0gcc 4.8.0 20130210
  44. 44. example#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    dst[i] = src[i++];    printf("%d %d %d %dn",dst[0], dst[1],dst[2], dst[3]);}$ gcc *.c && ./a.out$ gcc *.c && ./a.out0 2 0 0gcc 4.8.0 20130210#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    *(dst + i) = *(src + i++);    printf("%d %d %d %dn",dst[0], dst[1],dst[2], dst[3]);}
  45. 45. example#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    dst[i] = src[i++];    printf("%d %d %d %dn",dst[0], dst[1],dst[2], dst[3]);}$ gcc *.c && ./a.out $ gcc *.c && ./a.out$ gcc *.c && ./a.out0 2 0 0gcc 4.8.0 20130210#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    *(dst + i) = *(src + i++);    printf("%d %d %d %dn",dst[0], dst[1],dst[2], dst[3]);}
  46. 46. example#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    dst[i] = src[i++];    printf("%d %d %d %dn",dst[0], dst[1],dst[2], dst[3]);}$ gcc *.c && ./a.out $ gcc *.c && ./a.out$ gcc *.c && ./a.out0 2 0 0$ gcc *.c && ./a.out0 0 2 0gcc 4.8.0 20130210#include <stdio.h>int main(void){    int src[] = { 1,2,3,4 };    int dst[] = { 0,0,0,0 };    int i = 1;    *(dst + i) = *(src + i++);    printf("%d %d %d %dn",dst[0], dst[1],dst[2], dst[3]);}
  47. 47. precedence is not thesame as order ofevaluation
  48. 48. order of evaluation ismostly unspecifiedand is arun-time thing
  49. 49. precedence iscompletely specifiedand is acompile-time thing
  50. 50. precedence determineswhich operandsbind towhich operators
  51. 51. a * b + cexample
  52. 52. a * b + c?
  53. 53. a * b + c?
  54. 54. a() * b() + c()
  55. 55. temp_a = a();temp_b = b();temp_c = c();a * b + c
  56. 56. temp_c = c();temp_b = b();temp_a = a();a * b + c
  57. 57. temp_b = b();temp_c = c();temp_a = a();a * b + c
  58. 58. example#include <iostream>...int main(){int sum = a() + b();std::cout << sum;}#include <iostream>...int a(){std::cout << "a";return 3;}#include <iostream>...int b(){std::cout << "b";return 4;}http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  59. 59. example#include <iostream>...int main(){int sum = a() + b();std::cout << sum;}$ g++ *.c && ./a.out#include <iostream>...int a(){std::cout << "a";return 3;}#include <iostream>...int b(){std::cout << "b";return 4;}http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  60. 60. example#include <iostream>...int main(){int sum = a() + b();std::cout << sum;}$ g++ *.c && ./a.out#include <iostream>...int a(){std::cout << "a";return 3;}#include <iostream>...int b(){std::cout << "b";return 4;}$ g++ *.c && ./a.outab7http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  61. 61. example#include <iostream>...int main(){int sum = a() + b();std::cout << sum;}$ g++ *.c && ./a.out $ g++ *.c && ./a.out#include <iostream>...int a(){std::cout << "a";return 3;}#include <iostream>...int b(){std::cout << "b";return 4;}$ g++ *.c && ./a.outab7http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  62. 62. example#include <iostream>...int main(){int sum = a() + b();std::cout << sum;}$ g++ *.c && ./a.out $ g++ *.c && ./a.out#include <iostream>...int a(){std::cout << "a";return 3;}#include <iostream>...int b(){std::cout << "b";return 4;}$ g++ *.c && ./a.outab7$ g++ *.c && ./a.outba7http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  63. 63. indeterminate value6.2.4 Storage duration of objectsThe initial value of the object isindeterminate.J.2 Undefined behaviorThe value of an object withautomatic storage duration isused while it is indeterminate.
  64. 64. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gccWithout optimization...http://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  65. 65. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gccWithout optimization...truehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  66. 66. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gcc clangWithout optimization...truehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  67. 67. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gcc clangWithout optimization...true falsehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  68. 68. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gcc clang iccWithout optimization...true falsehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  69. 69. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gcc clang iccWithout optimization...true false truefalsehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  70. 70. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gcc clang iccWithout optimization...With optimization...true false truefalsehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  71. 71. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gcc clang iccWithout optimization...With optimization...true false truefalsefalsehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  72. 72. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gcc clang iccWithout optimization...With optimization...true false truefalsefalsehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  73. 73. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gcc clang iccWithout optimization...With optimization...true false truefalsefalse falsehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  74. 74. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gcc clang iccWithout optimization...With optimization...true false truefalsefalse falsehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  75. 75. example#include <stdio.h>#include <stdbool.h>void bar(void){bool b;if (b)printf("truen");if (!b)printf("falsen");}void foo(void);void bar(void);int main(void){foo();bar();}void foo(void){char c = 2;...}gcc clang iccWithout optimization...With optimization...true false truefalsefalse false falsehttp://www.pvv.org/~oma/UnspecifiedAndUndefined_ACCU_Apr2013.pdf
  76. 76. why do cars have brakes?
  77. 77. so you can drive faster!
  78. 78. do you do unittesting?
  79. 79. what do you meanby the wordunit ?
  80. 80. its nothing to dowith size
  81. 81. Atests
  82. 82. AtestsB
  83. 83. AtestsCB
  84. 84. AtestsCBD
  85. 85. AtestsCBDE
  86. 86. AtestsCBFDE
  87. 87. AtestsCBFGDE
  88. 88. AtestsCBFGDEexternal boundary
  89. 89. AtestsCBFGDdatabaseexternal boundary
  90. 90. AtestsCBFregistryDdatabaseexternal boundary
  91. 91. AtestsCBFregistryDfile systemexternal boundary
  92. 92. AtestsCBFsocketDfile systemexternal boundary
  93. 93. AtestsCBFsocketDfile systemexternal boundaryunit tests should pass or fail basedsolely on the correctness of our testsand our code
  94. 94. AtestsCBFsocketDfile systemexternal boundarynot based on the correctness ofexternal code and its environment
  95. 95. this means we haveto design "seams"into ourarchitecture
  96. 96. AtestsCBFsocketDfile systemsubstitutefile systemsubstitutesocketseamseam
  97. 97. this is ausefuldefinition
  98. 98. it meansunit testsare...
  99. 99. so fast, your basicdevelopmentactivity can changefrom...
  100. 100. re-compiling
  101. 101. to...
  102. 102. re-runningthe unit tests
  103. 103. this is not a merequantitativechange
  104. 104. it is aqualitativechange
  105. 105. some more about tests being...
  106. 106. void example_of_use(){q = snafu::instance().query(...)...snafu::instance().modifier(...);...}spot the anti-pattern
  107. 107. class snafu{public: // singletonstatic snafu & instance();public: // apiint query(...) const;void modifier(...);private: // inappropriatesnafu(const snafu &);snafu & operator=(const snafu &);private: // torssnafu();~snafu();};singleton
  108. 108. this is the only good singleton
  109. 109. AtestsCBFsocketDfile systemsubstitutefile systemsubstitutesocketseamseam1singleton
  110. 110. AunittestCBFD1danger
  111. 111. AunittestCBFD1anotherunittestdanger
  112. 112. you should beable to run yourunit tests inany order
  113. 113. you should beable to run yourunit tests inparallel
  114. 114. unit testsintegrationsystemno externaldependenciessome externaldependenciesall externaldependencies
  115. 115. waterfallanalysisdesignimplementtest
  116. 116. waterfallanalysisdesignimplementdebug
  117. 117. Debugging is twice as hard aswriting the code in the firstplace. Therefore, if you writethe code as cleverly as possible,you are, by definition, not smartenough to debug it.
  118. 118. "agile".........test.........test.........test
  119. 119. virtual destructor?class dice_roller{public:virtual ~dice_roller();...virtual int roll_dice() const = 0;};question:what does a virtual destructor mean?
  120. 120. virtual destructorclass random_dice_roller: publicdice_roller{public:...};answer:any code can delete a derived objectthrough a base class pointers*void contrived_example(){dice_roller * ptr =new random_dice_roller();...delete ptr;}* and it will work!
  121. 121. virtual destructorclass random_dice_roller: publicdice_roller{public:...};answer:any code can delete a derived objectthrough a base class pointers*void contrived_example(){dice_roller * ptr =new random_dice_roller();...delete ptr;}* and it will work!
  122. 122. virtual destructor?class random_dice_roller: publicdice_roller{public:...};question:should any code be able to writedelete expressions?void contrived_example(){dice_roller * ptr =new random_dice_roller();...delete ptr;}class dice_roller{public:virtual ~dice_roller();...};
  123. 123. virtual destructorsuppose you dont want arbitrary code tobe able to write delete expressions?void contrived_example(){dice_roller * ptr =new random_dice_roller();...delete ptr;}class dice_roller{public:...protected:~dice_roller();};
  124. 124. bad inheritancealphabetagammadeltanew alpha()new beta()new gamma()new delta()
  125. 125. good inheritancealpha beta gammaabstractiondeltaclient
  126. 126. factory patternabstractfactoryabstractproductconcreteproductconcretefactory<<creates>><<creates>>client
  127. 127. #include header#include "wibble.hpp"class fubar{};
  128. 128. inheritance#include "wibble.hpp"class fubar : public wibble // 1{};
  129. 129. member function parameters#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble &); // 3void ptr_parameter(wibble *); // 4};
  130. 130. member function return types#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble &); // 3void ptr_parameter(wibble *); // 4wibble value_result(); // 5wibble & ref_result(); // 6wibble * ptr_result(); // 7};
  131. 131. data members#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble &); // 3void ptr_parameter(wibble *); // 4wibble value_result(); // 5wibble & ref_result(); // 6wibble * ptr_result(); // 7wibble value; // 8wibble & ref; // 9wibble * ptr; // 10};
  132. 132. static data member#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble &); // 3void ptr_parameter(wibble *); // 4wibble value_result(); // 5wibble & ref_result(); // 6wibble * ptr_result(); // 7wibble value; // 8wibble & ref; // 9wibble * ptr; // 10static wibble shared_value; // 11static wibble & shared_ref; // 12static wibble * shared_ptr; // 13};
  133. 133. forward declarationclass wibble;class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble &); // 3void ptr_parameter(wibble *); // 4wibble value_result(); // 5wibble & ref_result(); // 6wibble * ptr_result(); // 7wibble value; // 8wibble & ref; // 9wibble * ptr; // 10static wibble shared_value; // 11static wibble & shared_ref; // 12static wibble * shared_ptr; // 13};
  134. 134. which of 1..13 require #include ?#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble &); // 3void ptr_parameter(wibble *); // 4wibble value_result(); // 5wibble & ref_result(); // 6wibble * ptr_result(); // 7wibble value; // 8wibble & ref; // 9wibble * ptr; // 10static wibble shared_value; // 11static wibble & shared_ref; // 12static wibble * shared_ptr; // 13};
  135. 135. my assistant willnow collect up theanswers
  136. 136. the answer is...class wibble;class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble &); // 3void ptr_parameter(wibble *); // 4wibble value_result(); // 5wibble & ref_result(); // 6wibble * ptr_result(); // 7wibble value; // 8wibble & ref; // 9wibble * ptr; // 10static wibble shared_value; // 11static wibble & shared_ptr; // 12static wibble * shared_ptr; // 13};
  137. 137. well see how you alldid shortly!
  138. 138. #include in .hpp .cpp#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"#include "snafu.hpp"#include "widget.hpp"class fubar{...};#endif#include "fubar.hpp"...fubar.hpp client.cpp
  139. 139. #ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class snafu;class widget;class fubar{...};#endif#include "fubar.hpp"#include "snafu.hpp"#include "widget.hpp"...fubar.hpp client.cpp• compile times down• physical coupling down• happiness up#include in .hpp .cpp
  140. 140. how much does a #include cost?#include <string>includer.cpp$ g++ -H includer.cpp &> lines$ wc -l lines
  141. 141. how much does a #include cost?#include <string>includer.cpp$ g++ -H includer.cpp &> lines$ wc -l lines. /usr/include/c++/4.2.1/string.. /usr/include/c++/4.2.1/bits/c++config.h... /usr/include/c++/4.2.1/bits/os_defines.h.... /usr/include/unistd.h..... /usr/include/_types.h...... /usr/include/sys/_types.h....... /usr/include/sys/cdefs.h........ /usr/include/sys/_symbol_aliasing.h........ /usr/include/sys/_posix_availability.h....... /usr/include/machine/_types.h........ /usr/include/i386/_types.h..... /usr/include/sys/unistd.h...... /usr/include/sys/cdefs.h............ /usr/include/c++/4.2.1/bits/stl_uninitialized.h... /usr/include/c++/4.2.1/bits/stl_algo.h.... /usr/include/c++/4.2.1/bits/stl_heap.h..... /usr/include/c++/4.2.1/debug/debug.h.... /usr/include/c++/4.2.1/bits/stl_tempbuf.h..... /usr/include/c++/4.2.1/memory.... /usr/include/c++/4.2.1/debug/debug.h.. /usr/include/c++/4.2.1/bits/basic_string.tcc
  142. 142. how much does a #include cost?#include <string>includer.cpp$ g++ -H includer.cpp &> lines$ wc -l lines. /usr/include/c++/4.2.1/string.. /usr/include/c++/4.2.1/bits/c++config.h... /usr/include/c++/4.2.1/bits/os_defines.h.... /usr/include/unistd.h..... /usr/include/_types.h...... /usr/include/sys/_types.h....... /usr/include/sys/cdefs.h........ /usr/include/sys/_symbol_aliasing.h........ /usr/include/sys/_posix_availability.h....... /usr/include/machine/_types.h........ /usr/include/i386/_types.h..... /usr/include/sys/unistd.h...... /usr/include/sys/cdefs.h............ /usr/include/c++/4.2.1/bits/stl_uninitialized.h... /usr/include/c++/4.2.1/bits/stl_algo.h.... /usr/include/c++/4.2.1/bits/stl_heap.h..... /usr/include/c++/4.2.1/debug/debug.h.... /usr/include/c++/4.2.1/bits/stl_tempbuf.h..... /usr/include/c++/4.2.1/memory.... /usr/include/c++/4.2.1/debug/debug.h.. /usr/include/c++/4.2.1/bits/basic_string.tcc$ g++ -H includer.cpp &> lines$ wc -l lines244 lines
  143. 143. you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class snafu;class widget;class fubar{...};#endifnamespace fishing{class snafu{...};}fubar.hppfishing/snafu.hppnamespace fishing{class widget{...};}fishing/widget.hpp
  144. 144. you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"namespace fishing{class snafu;class widget;}class fubar{...};#endiffubar.hppnamespace fishing{class snafu{...};}fishing/snafu.hppnamespace fishing{class widget{...};}fishing/widget.hpp
  145. 145. you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"namespace std{class string;}class fubar{...};#endifnamespace std{class string{...};}fubar.hpp <string>its not like this!
  146. 146. you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"namespace std{class string;}class fubar{...};#endifnamespace std{template<typename T>class basic_string{...};typedef basic_string<char> string;...}fubar.hpp <string>its a bit like this!
  147. 147. you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"namespace std{template<typename T>class basic_string;typdefbasic_string<char>string;}class fubar{...};#endifnamespace std{template<typename T>class basic_string{...};typedef basic_string<char> string;...}fubar.hpp <string>??
  148. 148. you must not tell lies!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"namespace std{template<typename T>class basic_string;typdefbasic_string<char>string;}class fubar{...};#endifnamespace std{template<typename T1,typename T2 = ...,typename T3 = ...>class basic_string{...};typedef basic_string<char> string;...}fubar.hpp <string>default template types
  149. 149. dont forward declareanything in std::
  150. 150. template#ifndef SNAFU_INCLUDED#define SNAFU_INCLUDED#include <algorithm>...template<typename T>class snafu{public:void reserve(int limit){std::for_each(...)}...};#endifsnafu.hpptemplates canincreasecoupling
  151. 151. template#ifndef SNAFU_INCLUDED#define SNAFU_INCLUDED...template<typename T>class snafu{public:void reserve(int limit);...};#include "snafu-template.hpp"#endif#include <algorithm>template<typename T>void snafu<T>::reserve(int limit){std::for_each(...)}...snafu.hpp snafu-template.hpptemplates canincreasecoupling
  152. 152. inline#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include <vector>class fubar{public:typedef std::vector<int>::iterator iterator;void algo(iterator from, iterator to){...}...};inlining usually increases couplingfubar.hpp
  153. 153. template#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED...class fubar{public:template<typename iterator>void algo(iterator from,iterator to){...}...};#endif#include "fubar.hpp"#include <vector>void eg(std::vector<int> & v){fubar f;f.algo(v.begin(), v.end());}fubar.hppexample.cpptemplates canalso decreasecoupling!
  154. 154. does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class fubar{public:...void fu();...private:std::vector<wibble> wibbles;};#endif#include <vector>#include "fubar.hpp"void fubar::fu(){...}fubar.hpp fubar.cpp
  155. 155. does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class fubar{public:...void fu();...private:std::vector<wibble> wibbles;};#endif#include <vector>#include "fubar.hpp"void fubar::fu(){...}fubar.hpp fubar.cppyes
  156. 156. does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class fubar{public:...void fu();...private:std::vector<wibble> wibbles;};#endif#include "fubar.hpp"#include <vector>void fubar::fu(){...}fubar.hpp fubar.cpp
  157. 157. does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class fubar{public:...void fu();...private:std::vector<wibble> wibbles;};#endif#include "fubar.hpp"#include <vector>void fubar::fu(){...}fubar.hpp fubar.cppno
  158. 158. #ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"class fubar{public:...void fu();...private:std::vector<wibble> wibbles;};#endif#include "fubar.hpp"#include <vector>void fubar::fu(){...}fubar.hpp fubar.cpp
  159. 159. does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"#include <vector>class fubar{public:...void fu();...private:std::vector<wibble> wibbles;};#endif#include "fubar.hpp"...void fubar::fu(){...}fubar.hpp fubar.cpp
  160. 160. does this compile?#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"#include <vector>class fubar{public:...void fu();...private:std::vector<wibble> wibbles;};#endif#include "fubar.hpp"...void fubar::fu(){...}fubar.hpp fubar.cppyes
  161. 161. include your own header 1st#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"#include <vector>class fubar{public:...void fu();...private:std::vector<wibble> wibbles;};#endif#include "fubar.hpp"...void fubar::fu(){...}fubar.hpp fubar.cpp
  162. 162. better still - make sure eachheader compiles (on its own) aspart of the build!#ifndef FUBAR_INCLUDED#define FUBAR_INCLUDED#include "wibble.hpp"#include <vector>class fubar{public:...void fu();...private:std::vector<wibble> wibbles;};#endiffubar.hpp
  163. 163. rememberthis...
  164. 164. #include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble &); // 3void ptr_parameter(wibble *); // 4wibble value_result(); // 5wibble & ref_result(); // 6wibble * ptr_result(); // 7wibble value; // 8wibble & ref; // 9wibble * ptr; // 10static wibble shared_value; // 11};
  165. 165. the answer is...#include "wibble.hpp"class fubar : public wibble // 1{void value_parameter(wibble ); // 2void ref_parameter(wibble &); // 3void ptr_parameter(wibble *); // 4wibble value_result(); // 5wibble & ref_result(); // 6wibble * ptr_result(); // 7wibble value; // 8wibble & ref; // 9wibble * ptr; // 10static wibble shared_value; // 11};
  166. 166. how did youall do?
  167. 167. over to myassistant...
  168. 168. the Satir change curveold status quonew status quo old status quoforeign elementresistanceandchaos integrationandpracticetimecompetence
  169. 169. @JonJaggerjon@jaggersoft.com

×