aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bdep/new-types.hxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/bdep/new-types.hxx b/bdep/new-types.hxx
index 6cfb2b3..59df3cb 100644
--- a/bdep/new-types.hxx
+++ b/bdep/new-types.hxx
@@ -43,7 +43,7 @@ namespace bdep
// Default is exe with no options.
//
- cmd_new_type_template (): type (exe) {}
+ cmd_new_type_template (type_type t = exe): type (t) {}
const std::string
string () const
@@ -62,9 +62,9 @@ namespace bdep
}
friend ostream&
- operator<< (ostream& os, const cmd_new_type_template& t)
+ operator<< (ostream& os, type_type t)
{
- return os << t.string ();
+ return os << cmd_new_type_template (t).string ();
}
};
@@ -88,7 +88,7 @@ namespace bdep
// Default is C++ with no options.
//
- cmd_new_lang_template (): lang (cxx) {}
+ cmd_new_lang_template (lang_type l = cxx): lang (l) {}
const std::string
string (bool lower = false) const
@@ -105,9 +105,9 @@ namespace bdep
}
friend ostream&
- operator<< (ostream& os, const cmd_new_lang_template& l)
+ operator<< (ostream& os, lang_type l)
{
- return os << l.string ();
+ return os << cmd_new_lang_template (l).string ();
}
};
@@ -134,7 +134,7 @@ namespace bdep
// Default is git with no options.
//
- cmd_new_vcs_template (): vcs (git) {}
+ cmd_new_vcs_template (vcs_type v = git): vcs (v) {}
const std::string
string () const
@@ -149,6 +149,12 @@ namespace bdep
return std::string (); // Should never reach.
}
+
+ friend ostream&
+ operator<< (ostream& os, vcs_type v)
+ {
+ return os << cmd_new_vcs_template (v).string ();
+ }
};
using cmd_new_vcs = cmd_new_vcs_template<>;