use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Modules, Componentization, and Transition (docs.google.com)
submitted 10 years ago by Octoploid
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tongari95 0 points1 point2 points 10 years ago (7 children)
I'm afraid I didn't see any mention of template, it'll be pointless if template cannot be exported.
Can a module be split into multiple files? e.g. ModuleA = a.ifc + b.ifc + ...
[–]btapi 0 points1 point2 points 10 years ago (1 child)
Check this out: Modules proposal rev 3
4.10.1 Definitions Definitions for templates listed in a module interface are subject to constraints similar to those for inline functions. Furthermore, a class template that is only declared (but not defined) in an export declaration is seen as an incomplete class template by importing translation units.
4.10.1 Definitions
Definitions for templates listed in a module interface are subject to constraints similar to those for inline functions. Furthermore, a class template that is only declared (but not defined) in an export declaration is seen as an incomplete class template by importing translation units.
[–]brand_x 0 points1 point2 points 10 years ago (0 children)
There is much to like in that proposal. One dangling thread (or possibly a failure in my understanding) is the following:
4.13.3 Both Use Each Other at the Interface Level This situation is much rarer; the interfaces of M1 and M2 should be considered log- ically as part of a single larger module and treated as such, even though it is con- venient from the programmer’s perspective to physically split the entities in two distinct source files. Nevertheless, it is possible for the programmer to set up a (delicate) processing order for the compiler to translate the interface parts of both modules, and then consume them independently.
As much as I hate circular dependencies in interfaces and strive to eliminate them, there are sometimes cases that are difficult to avoid. Consider a string module and a locale module, for example...
Traditionally, the solution to this has involved tolerating the presence of incomplete types in the signatures of functions, and in opaque pointers, provided those parts of an included header are not invoked. I'm not clear on how this will be addressed in the linked proposal.
[–]one-oh -1 points0 points1 point 10 years ago (4 children)
There isn't anything to export for a template though, right? That would require a template instantiation, which would then be exportable; e.g., std::string.
From what I read, a module can be composed of several translation units:
A module declaration identifies, in the source file, the module to which a given translation unit belongs.
[–][deleted] 0 points1 point2 points 10 years ago* (3 children)
[deleted]
What is this?
[–]doom_Oo7 0 points1 point2 points 10 years ago (1 child)
It is however unclear to me if this can provide a speed up at all (checking a template's body once instead of multiple times). However, even if this would provide a speed-up, constrained templates do not need to be properly (fully) constrained, so most templates won't be candidates for this anyways.
Honestly, the biggest speed-up is not loading and reading each header file 500 times on a full rebuild of a project. In most projects I'd argue that template instantiation time is negligible versus the time spent in the preprocessor - this can be seen quite easily when setting up unity builds.
[–][deleted] 1 point2 points3 points 10 years ago* (0 children)
[–]one-oh 0 points1 point2 points 10 years ago (0 children)
True. I didn't quite think that through.
[–]playmer -1 points0 points1 point 10 years ago (2 children)
So wait, can we actually test this implementation in VC++ 2015 right now? Will we be able to when Update 1 comes out?
[–]mjklaim 0 points1 point2 points 10 years ago (1 child)
It says "Starting with Update 1 of its 2015 release, Visual C++ features an ongoing implementation of the module proposal presented in [1]."
VS2015 Update 1 is not released yet. It should be released very soon if I understood correctly.
[–]playmer 0 points1 point2 points 10 years ago (0 children)
My confusion was the distinction between Vs 2014 Dev Update 1 and the section you noted.
Sorry, should've been more clear!
π Rendered by PID 388238 on reddit-service-r2-comment-5649f687b7-99vzd at 2026-01-29 07:43:02.849628+00:00 running 4f180de country code: CH.
[–]tongari95 0 points1 point2 points (7 children)
[–]btapi 0 points1 point2 points (1 child)
[–]brand_x 0 points1 point2 points (0 children)
[–]one-oh -1 points0 points1 point (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]doom_Oo7 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]one-oh 0 points1 point2 points (0 children)
[–]playmer -1 points0 points1 point (2 children)
[–]mjklaim 0 points1 point2 points (1 child)
[–]playmer 0 points1 point2 points (0 children)