Created
November 5, 2022 11:48
-
-
Save jakobrs/4b50609f29bee6fc7eaca17707b4a9b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/* | |
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; | |
} | |
//""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[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