python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Is there a way to mark a function as only called/callable from a static constructor?
I have quite a sizeable static constructor for one of my classes, and was wanting to refactor it to encapsulate various bits of the initialization within static functions.
One of the things this stati...
fweaks
Votes: 0
Answers: 2
Static constructor order in inherited generic classes
Using the following code as an example ...
public class ClassA<T> where T : new()
{
static ClassA()
{
Debug.WriteLine("static ctor A");
}
public static T TA = n...
3-14159265358979323846264
Votes: 0
Answers: 2
Why can compiler not optimize out unused static std::string?
If I compile this code with GCC or Clang and enable -O2 optimizations, I still get some global object initialization. Is it even possible for any code to reach these variables?
#include <string>...
Vemulo
Votes: 0
Answers: 1