Skip to content

Instantly share code, notes, and snippets.

@jakobrs
Created November 5, 2022 11:48
Show Gist options
  • Save jakobrs/4b50609f29bee6fc7eaca17707b4a9b6 to your computer and use it in GitHub Desktop.
Save jakobrs/4b50609f29bee6fc7eaca17707b4a9b6 to your computer and use it in GitHub Desktop.
#/*
import os
import fcntl
out = os.memfd_create("a.out")
fcntl.fcntl(out, fcntl.F_SETFD, 0) # remove FD_CLOEXEC
os.system(f"g++ {__file__} -o /proc/self/fd/{out}")
os.system(f"/proc/self/fd/{out}")
"""
*/
#include <iostream>
#include <set>
int main() {
std::set<int> s;
s.insert(1);
s.insert(3);
s.insert(2);
for (auto i : s) {
std::cout << i << '\n';
}
return 0;
}
//"""
#[doc = ""] /*
import os
import tempfile
with tempfile.TemporaryDirectory() as dir:
os.system(f"rustc {__file__} -o {dir}/main")
os.system(f"{dir}/main")
"""
*/
use std::collections::BTreeSet;
fn main() {
let mut set = BTreeSet::new();
set.insert(1);
set.insert(3);
set.insert(2);
for &i in &set {
println!("{i}");
}
}
//"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment