26

Re: How correctly to connect h - files?

AlekseySQL wrote:

it is passed...
Duplication that remove, but not in each file even these data types are once necessary to me. If to develop my approach half of standard library will be connected to each file in process of project growth + half of library Qt...

You should understand a difference between the declaration and determination. Also between determination of a template and it .
Also how the link editor () works.
In general, all your fears it is simple a paranoia of the ignoramus.
Study language.

27

Re: How correctly to connect h - files?

AlekseySQL wrote:

it is passed...
At similar directives the preprocessor includes files of libraries in EACH compilation unit only one time. Compilation unit in With ++ is the file. In other words, as I also wrote to each file of the project on time will be connected a heap of lib files.

Well also what? The sample code for example EVEN WILL NOT be compiled, if it is not used really.

28

Re: How correctly to connect h - files?

Dimitry Sibiryakov wrote:

it is passed...
Name two which do not support it. Ancient versions - it is not counted.

Yes already all support it, but nevertheless in the standard it is not present....

29

Re: How correctly to connect h - files?

AlekseySQL wrote:

...
Excites... Swelling of the code from - for adding of unnecessary declarations in all files of the project.

Tell that you imply under " code swelling ", make the full torn determination.

AlekseySQL wrote:

From - for it sensation that code maintainability is reduced.

Generally totally ludicrous...

30

Re: How correctly to connect h - files?

kealon (Ruslan) wrote:

AlekseySQL;
Google extern template

Yes it is not supported by anybody already...

31

Re: How correctly to connect h - files?

AlekseySQL wrote:

it is passed...
Yes, I also am afraid of it:)

Be not afraid, it will not be interposed.
On it there is a global optimization.
"Will be interposed" a lot of code when you will use the same template for different parameters of a template (will be generated), for example, usage std:: vector for char, int, std:: string, float, double generates the template code std:: vector in five copies, but only in volume of used methods in all specific cases.

32

Re: How correctly to connect h - files?

AlekseySQL wrote:

Excites not speed of compilation (with which  precompiled titles), and swelling of the code from - for adding of unnecessary declarations in all files of the project. From - for it sensation that code maintainability is reduced.

you slightly.
The compiler adds references to characters which were necessary in specific unit of translation and places them in the total object file, together with all  sample types and functions.
When you collect an executed file,  goes from entry point on all [b characters transitively [/b] (recursively), selecting only necessary characters which will be included in the total assembly, that is, ignores those characters on which there were no links during the recursive pass even if it there were characters from static libraries (archives of object files).
with divided libraries the situation is different on different .
No inflating here happens, if you do not want to include, for example, completely static library in the assembly an option  whole archive .

33

Re: How correctly to connect h - files?

than to plant anxiety for no reason, for a long time already would include generation
Map-file and looked at what characters and in what amount in it are included.

34

Re: How correctly to connect h - files?

MasterZiv, it is good  smile

35

Re: How correctly to connect h - files?

AlekseySQL wrote:

MasterZiv, it is good  smile

It it in a temper , without checking up. The problem really is, on midges precisely

36

Re: How correctly to connect h - files?

Unpretentious check:
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)
[spoiler] Release AND Debug
a <> b
a=b
a=b
a <> b
a <> b
2 [/spoiler]
Microsoft Visual C ++ 2015
[spoiler] Release
a=b
a=b
a=b
a=b
a=b
2
Debug
a <> b
a=b
a=b
a <> b
a <> b
2
[/spoiler]
WITH ++ Builder 10.2 Update 1
[spoiler] Release AND Debug
a <> b
a=b
a=b
a <> b
a <> b
2 [/spoiler]
is not present

37

Re: How correctly to connect h - files?

AlekseySQL;
If at you something turned on two times, the compiler would swear that at you two identical determinations something.
On the other hand, vector (and remaining containers) is a template, in itself it does not form the code.