Skip to content

Instantly share code, notes, and snippets.

@AntonNik0laev
Created December 16, 2015 17:11
Show Gist options
  • Save AntonNik0laev/3e8e144fe0b5bfbbbd3e to your computer and use it in GitHub Desktop.
Save AntonNik0laev/3e8e144fe0b5bfbbbd3e to your computer and use it in GitHub Desktop.
ms modules
//module A : >cl /c /experimental:module .\ModuleA.ixx
module A;
#include <iostream>
export int f(int x) {
return x * 2;
}
export class C {
public:
void Hello() {
std::cout << "hello" << std::endl;
}
};
///Main: >cl /experimental:module /module:reference A.ifc main.cpp ModuleA.obj
import A;
#include <iostream>
int main() {
std::cout << f(5) << std::endl;
C c;
c.Hello();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment