compile-time-constant
Common constants for an AVR / Linux GCC C++ project
I\'m creating software for an Linux + AVR Arduino project. Obviously the whole work is split in several projects in Eclipse (I\'m n开发者_如何学运维ot using Arduino IDE). I\'d like to use common, most[详细]
2023-04-02 21:02 分类:问答C# - Why are DateTime.MinValue and MaxValue not compile-time constants?
I wanted to have an optional date parameter for a method (defaulted to MinValue), in order to check if the user had actually supplied a value or not (supplying MinValue was invalid), but I\'m not allo[详细]
2023-03-23 17:31 分类:问答Hexadecimal constant in C is unsigned even though L suffix
I know this is a simple question but I\'m confused. I have a fairly typical gcc warning that\'s usually easy to fix:[详细]
2023-03-21 12:22 分类:问答How do I output a compile-time numeric constant during compilation in Visual C++?
Visual C++ has #pragma message that outputs a string into compiler output. Now I have a factory: template<class Type>[详细]
2023-02-28 17:51 分类:问答Defining colors as constants in C#
I\'ve set up some default colors in a C# winforms application like so: readonly Color ERROR = Color.Red;[详细]
2023-02-18 00:26 分类:问答Where to put compile-time-constant arrays?
Say I have an array storing the first 10 primes, like this: const int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};[详细]
2023-02-12 03:53 分类:问答Why doesn't a Java constant divided by zero produce compile time error? [duplicate]
This question already has answers here: Closed 12 years ago. Possible Duplicate: Is 1/0 a legal Java expression?[详细]
2023-02-10 07:30 分类:问答How to declare a constant Guid in C#?
Is it possible to declare a cons开发者_Python百科tant Guid in C#? I understand that I can declare a static readonly Guid, but is there a syntax that allows me to write const Guid?No. The const modifi[详细]
2023-02-09 06:44 分类:问答How to efficiently implement an immutable graph of heterogenous immutable objects in C++?
I am writing a programming language text parser, out of curiosity. Say i want to define an immutable (at runtime) graph of tokens as vertices/nodes. These are naturally of different type - some tokens[详细]
2023-01-22 05:46 分类:问答Java switch statement: Constant expression required, but it IS constant
So, I am working on this class that has a few static constants: public abstract class Foo { ... public static final int BAR;[详细]
2023-01-18 16:45 分类:问答