C++ streams in Rust
Are you tired of annyoing println!
calls? Do you miss your glorious std::cout
in Rust?
Examples
use *;
use *;
use *;
use *;
Are you tired of annyoing println!
calls? Do you miss your glorious std::cout
in Rust?
use cppstreams::*;
fn main() {
Cout << "Hello, world!" << Endl;
}
use cppstreams::*;
fn main() {
let mut a: i32 = Default::default();
let mut b: i32 = Default::default();
Cin >> &mut a;
Cin >> &mut b;
Cout << a << " + " << b << " = " << (a + b) << Endl;
}
use cppstreams::*;
fn main() {
let mut str_stream = StringStream::default();
&mut str_stream << "Hello";
&mut str_stream << ',' << ' ';
&mut str_stream << "world!";
Cout << str_stream << Endl;
}
use cppstreams::*;
#[allow(unused_must_use)]
fn main() {
let data = vec![1, 2, 3, 4];
// output
Cout << debug!(data) << Endl;
// complex formatting without allocating a String
Cout << formatted!("{data:#?}") << Endl;
}