aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.ucl/emit.ccm
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-06-23 18:34:18 +0100
committerLexi Winter <lexi@le-fay.org>2025-06-23 18:34:18 +0100
commit32b4443ba2ec5c3f7c09221ab9b21911a3126ef9 (patch)
treecb6346997078626dc512e5e46e95796e375690ee /nihil.ucl/emit.ccm
parentd5963532328ce5f1c9f266bf7e760b7d18a60c15 (diff)
downloadnihil-32b4443ba2ec5c3f7c09221ab9b21911a3126ef9.tar.gz
nihil-32b4443ba2ec5c3f7c09221ab9b21911a3126ef9.tar.bz2
add separate module implementation files
Diffstat (limited to 'nihil.ucl/emit.ccm')
-rw-r--r--nihil.ucl/emit.ccm15
1 files changed, 5 insertions, 10 deletions
diff --git a/nihil.ucl/emit.ccm b/nihil.ucl/emit.ccm
index c4aa79b..849c5a7 100644
--- a/nihil.ucl/emit.ccm
+++ b/nihil.ucl/emit.ccm
@@ -9,7 +9,7 @@ module;
#include <cstdlib>
#include <format>
#include <iterator>
-#include <iostream>
+#include <iosfwd>
#include <span>
#include <string>
#include <utility>
@@ -34,8 +34,8 @@ export enum struct emitter {
*
* We can't throw exceptions here since we're called from C code. The emit
* functions return an integer value, but it's not really clear what this is
- * for (for example, returning errors?) and the C API seems to mostly ignore
- * it. So, we just eat errors and keep going.
+ * for and the C API seems to mostly ignore it. So, we just eat errors and
+ * keep going.
*/
template<std::output_iterator<char> Iterator>
struct emit_wrapper {
@@ -130,7 +130,7 @@ private:
export auto emit(object const &object, emitter format,
std::output_iterator<char> auto &&it)
- -> void
+-> void
{
auto ucl_format = static_cast<ucl_emitter>(format);
auto wrapper = emit_wrapper(it);
@@ -144,12 +144,7 @@ export auto emit(object const &object, emitter format,
* Basic ostream printer for UCL; default to JSON since it's probably what
* most people expect.
*/
-export auto operator<<(std::ostream &stream, object const &o)
- -> std::ostream &
-{
- emit(o, emitter::json, std::ostream_iterator<char>(stream));
- return stream;
-}
+export auto operator<<(std::ostream &stream, object const &o) -> std::ostream &;
} // namespace nihil::ucl