Skip to content

Commit

Permalink
Objects should be passed by reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfjlaros committed Apr 9, 2019
1 parent ae0ab27 commit 87b87f0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/types.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Prototypes needed for recursive definitions.
*/
template<class T>
String _typeof(Vector <T>);
String _typeof(Vector <T>&);


/*
Expand Down Expand Up @@ -94,7 +94,7 @@ inline String _typeof(double) {
/**
* Recursion terminator for {_typeof(Tuple)}.
*/
inline String _typeof(Tuple <>) {
inline String _typeof(Tuple <>&) {
return "";
}

Expand All @@ -104,7 +104,7 @@ inline String _typeof(Tuple <>) {
* @return {String} - Tuple member types.
*/
template<class... Args>
String _typeof(Tuple <Args...>t) {
String _typeof(Tuple <Args...>&t) {
return _typeof(t.head) + _typeof(t.tail);
}

Expand All @@ -115,16 +115,16 @@ String _typeof(Tuple <Args...>t) {
* @return {String} - Object member types.
*/
template<class... Args>
String _typeof(Object <Args...>o) {
return "(" + _typeof((Tuple <Args...>)o) + ")";
String _typeof(Object <Args...>&o) {
return "(" + _typeof((Tuple <Args...>&)o) + ")";
}


/**
* Vector type.
*/
template<class T>
String _typeof(Vector <T>) {
String _typeof(Vector <T>&) {
T x;

return "[" + _typeof(x) + "]";
Expand Down

0 comments on commit 87b87f0

Please sign in to comment.