Created
December 16, 2015 17:11
-
-
Save AntonNik0laev/3e8e144fe0b5bfbbbd3e to your computer and use it in GitHub Desktop.
ms modules
This file contains 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
//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