Questions tagged [compilation-time]
40 questions
0
votes
1 answer
Could more namespaces improve compilation time?
I work with a very large codebase (above 3K translation units) in which almost every declaration is under the same namespace. Occasionally, some sub-namespaces are declared, but it is definitely not the rule.
I was wondering: could compilation time…

thebugger
- 123
- 6
0
votes
1 answer
C# - Check at compilation level arguments in the generic type constraints | ... where T : new( Foo a )
The very-well known constraint in generic types is new(), it is possible to add parameters like (args,args,...) to force the compiler to check that the class contains a particular constructor?
The block shows you the case.
public class FooType
{
…

Fabio Andrés
- 229
- 2
- 11
0
votes
3 answers
Java - Create a Card object without enum, with compilation time type checking
I want to create a class that would provide me with a card
i.e
Card c = new Card(1) // where the builder should get values 1 to 4, representing 1=spade, 2=heart, 3=diamond, 4=clubs
c.getType() // spade
I want the class to check during compilation…

Max Shapiro
- 11
- 1
0
votes
0 answers
Reduce binary size and compilation time when using a C++ header-only library
I'm creating a GDScript wrapper library using tiny-dnn C++ library as base.
The issue is that tiny-dnn is header-only, and I have to include it in most of my library's .cpp files (after all, I'm creating a wrapper). This results in a compilation…

IceMage144
- 3
- 2
0
votes
1 answer
dllexport class template instances (specializations), reducing compilation time for header-only template libraries
Is it possible to export some of the class template instances, while leaving to a library's user the ability of generating other specializations of a given class template (when compiling the executable).
Given I have a public header
//…

Sergey Kolesnik
- 3,009
- 1
- 8
- 28
0
votes
1 answer
Compiling subset of tests in Google Test
Using flags to limit the tests run in Google Test framework is great, but in my case most of the time is wasted on waiting for the entire test project to compile again and again while I'm writing tests.
Is there an easy way to limit the compilation…

Jonathan Livni
- 101,334
- 104
- 266
- 359
0
votes
1 answer
IMarkupExtension - Check property type during compilation time (xamarin.forms)
I would like to throw an exception during compilation time if the given parameter in the IMarkupExtension is not compatible with the type expected by me.
Can I achieve this effect?
Below I put my experiments, but I do not know where and how to check…

g_m
- 456
- 1
- 3
- 12
0
votes
1 answer
How to create compile-time templatized set/array/vector with fibonacci numbers using templates?
I have a class template
template class A {
static_assert(std::is_arithmetic::value, "U type must be arithmetic");
public:
const std::set fibonacci = ???; //May be any structure with…

Jecke
- 239
- 2
- 13
0
votes
4 answers
How to reduce compile time for large C++ library of individual .cpp files?
We're developing a C++ library with currently over 500 hundred individual .cpp files. These are each compiled and archived into a static library. Even with a parallel build, this takes some minutes. I'd like to reduce this compilation time.
Each…

Alec Jacobson
- 6,032
- 5
- 51
- 88
0
votes
0 answers
File smaller => Compilation time longer?
I've got some old C files, written in 1999 for the older. There are some useless parts of the code because of new programming techniques. But I've got a problem.
The original file => 640 lines --> 0.448 seconds
The new file => 581 lines --> 0.493…

CloudCompany
- 357
- 3
- 15