Skip to content

Modules

Liu Jun edited this page Dec 9, 2019 · 2 revisions

It's awful to write declaration at .h file and implementation at .cpp file.

With modules, you can write them at the same place. Using import and export to import from and export to modules.

// unimplemented
import std::io;

module m;
export{
    fn api() -> i32;
}

Clone this wiki locally