Skip to content

Instantly share code, notes, and snippets.

@lukewilson2002
Created November 25, 2018 18:14
Show Gist options
  • Save lukewilson2002/295df5139fd22798d6881b1d8286a500 to your computer and use it in GitHub Desktop.
Save lukewilson2002/295df5139fd22798d6881b1d8286a500 to your computer and use it in GitHub Desktop.
Created by repnop and Violetas The Crusader in the Rust Programming Language Discord server for satirical purposes.
#[allow(bad_style)]
struct cout;
impl<T: std::fmt::Display> std::ops::Shl<T> for cout {
type Output = cout;
fn shl(self, rhs: T) -> cout {
print!("{}", rhs);
cout
}
}
#[allow(bad_style)]
struct endl;
impl std::fmt::Display for endl {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
writeln!(f, "")
}
}
fn main() {
cout << "Hello, world!" << endl << "Foo bar";
//Hello, world!
//Foo bar
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment