Skip to content

Instantly share code, notes, and snippets.

Created April 22, 2013 11:47
Show Gist options
  • Save anonymous/5434187 to your computer and use it in GitHub Desktop.
Save anonymous/5434187 to your computer and use it in GitHub Desktop.
Example of using Doxygen
#include "ExampleClass.h"
namespace example
{
ExampleClass::ExampleClass() :
x_(0),
y_(0)
{}
ExampleClass::~ExampleClass()
{}
void ExampleClass::swap(int& x, int& y)
{
int temp;
temp = y;
y = x;
x = temp;
}
int ExampleClass::add(int x, int y)
{
return x + y;
}
void ExampleClass::add(int x, int y, int& z)
{
z = x + y;
}
int ExampleClass::add()
{
return x_ + y_;
}
void ExampleClass::add(int& z)
{
z = x_ + y_;
}
}
// Clearly with no documentation it is difficult to read
// and understand the intention of this class.
// At best one can make guesses based off experience and context
#ifndef EXAMPLE_CLASS_H_
#define EXAMPLE_CLASS_H_
namespace example
{
class ExampleClass
{
public:
ExampleClass();
~ExampleClass();
void swap(int& x, int& y);
int add(int x, int y);
void add(int x, int y, int& z);
int add();
void add(int& z);
private:
int x_;
int y_;
};
}
#endif // EXAMPLE_CLASS_H_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment