Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preprocessor check to exclude string and stream code. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/gml/mat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
#include <assert.h>
#include <cmath>
#include <cstdint>
#ifndef GML_EMBEDDED
#include <iostream>
#include <sstream>
#include <string>
#endif
#include <tuple>

#include "vec.hpp"
Expand Down Expand Up @@ -265,6 +267,7 @@ mat<T, C, R> operator*(const T& a, const mat<T, C, R>& m) {
return temp;
}

#ifndef GML_EMBEDDED

/// Prints the matrix to a stream inside brackets columns separated by a comma.
template <typename T, int C, int R>
Expand Down Expand Up @@ -301,6 +304,7 @@ std::string to_string(const mat<T, C, R>& m) {
return ss.str();
}

#endif

/// Returns the transpose of the matrix.
template <typename T, int C, int R>
Expand Down
6 changes: 6 additions & 0 deletions include/gml/quaternion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
#include <assert.h>
#include <cmath>
#include <cstdint>
#ifndef GML_EMBEDDED
#include <iostream>
#include <sstream>
#include <string>
#endif
#include <tuple>

#include "vec.hpp"
Expand Down Expand Up @@ -208,6 +210,8 @@ quaternion<T> operator-(const vec<T, 3>& v, const quaternion<T>& q) {
}


#ifndef GML_EMBEDDED

/// Write a quaternion to a stream inside brackets parts separated by a comma.
template <typename T>
std::ostream& operator<<(std::ostream& os, const quaternion<T>& q) {
Expand All @@ -234,6 +238,8 @@ std::string to_string(const quaternion<T>& q) {
return ss.str();
}

#endif


/// Returns the squared magnitude of the quaternion q
template <typename T>
Expand Down
8 changes: 7 additions & 1 deletion include/gml/vec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
#include <assert.h>
#include <cmath>
#include <cstdint>
#include <iostream>
#include <limits>
#ifndef GML_EMBEDDED
#include <iostream>
#include <sstream>
#include <string>
#endif
#include <utility>

namespace gml {
Expand Down Expand Up @@ -346,6 +348,8 @@ vec<T, N> operator/(const T& a, const vec<T, N>& v) {
}


#ifndef GML_EMBEDDED

/// Prints the vector to a stream inside brackets components separated by a comma.
template <typename T, int N>
std::ostream& operator<<(std::ostream& os, const vec<T, N>& v) {
Expand Down Expand Up @@ -381,6 +385,8 @@ std::string to_string(const vec<T, N>& v) {
return ss.str();
}

#endif


/// Dot products of vectors v1 and v2
template <typename T, int N>
Expand Down