Skip to content

Commit

Permalink
forward declare ostream and use nullptr instead of NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Aug 26, 2016
1 parent a949c83 commit 7492236
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/gsl_vector.cpp
Expand Up @@ -20,20 +20,21 @@
#include "error.hpp"

#include <cmath>
#include <iostream>
#include <string>
#include <utility>

namespace flexiblesusy {

GSL_vector::GSL_vector()
: vec(NULL)
: vec(nullptr)
{
}

GSL_vector::GSL_vector(std::size_t size)
{
if (!size) {
vec = NULL;
vec = nullptr;
return;
}

Expand All @@ -46,7 +47,7 @@ GSL_vector::GSL_vector(std::size_t size)
}

GSL_vector::GSL_vector(const gsl_vector* v)
: vec(NULL)
: vec(nullptr)
{
assign(v);
}
Expand All @@ -71,7 +72,7 @@ GSL_vector::GSL_vector(GSL_vector&& other) noexcept
GSL_vector::GSL_vector(std::initializer_list<double> list)
{
if (list.size() == 0) {
vec = NULL;
vec = nullptr;
return;
}

Expand All @@ -94,7 +95,7 @@ void GSL_vector::assign(const gsl_vector* other)
{
if (!other) {
gsl_vector_free(vec);
vec = NULL;
vec = nullptr;
return;
}

Expand Down Expand Up @@ -185,7 +186,7 @@ std::ostream& operator<<(std::ostream& ostr, const GSL_vector& vec)
void GSL_vector::move_assign(GSL_vector&& other) noexcept
{
vec = other.vec;
other.vec = NULL;
other.vec = nullptr;
}

void GSL_vector::range_check(std::size_t n) const
Expand Down
2 changes: 1 addition & 1 deletion src/gsl_vector.hpp
Expand Up @@ -21,7 +21,7 @@

#include <gsl/gsl_vector.h>
#include <initializer_list>
#include <iostream>
#include <iosfwd>
#include <cstddef>

namespace flexiblesusy {
Expand Down

0 comments on commit 7492236

Please sign in to comment.