Questions tagged [compile-time-constant]

Use this tag for questions related to the compile time constant, a constant value that is known at compile time.

A expression is an expression denoting a value of primitive type or a String that is composed using only the following:

is uses in its general meaning, but you should provide the relevant tag of your programming environment, if any.

300 questions
0
votes
3 answers

Pass Class as Optional Parameter Within a Another Class Constructor Without Compile-Time Constant Error

In this example assume we have a class: public class Test { int a; int b; int c; public Test(int a = 1, int b = 2, int c = 3) { this.a = a; this.b = b; this.c = c; } } All parameters are optional so…
DanteTheEgregore
  • 1,530
  • 5
  • 23
  • 44
0
votes
0 answers

AS3 1046: Type was not found or was not a compile-time constant: Baddie

I'm having issues with a program I've been working on function checkForHit(baddie:Baddie):void { for (var i:int = 0; i < bullets.length; i++) { if (baddie.hitTestPoint(bullets[i].x,bullets[i].y,true)) { removeChild(baddie); …
0
votes
2 answers

How to give dynamically created buttons actions for each one - part 2

Hi again fellow Flashers :) My first question poised here at StackOverFlow dealt with this issue, I had an array which created a few different buttons. However I didn't know how to assign actions to them: How to give dynamically created buttons…
Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
0
votes
1 answer

hitTestpoint giving error in Action Script 3

I am trying to get hitTestPoint to work. When I type this in, I get this error: Scene 1 1046: Type was not found or was not a compile-time constant: mcircle. Here is the code I have: import flash.events.Event; …
jackbtroop62
  • 63
  • 1
  • 5
-1
votes
1 answer

Specifying uncached compile-time constants in CMakeLists file

In one of my CMakeList files I specified an option which conditionally defines a compile-time constant in a generated header file. However, I recognized that the value of the option is being cached by cmake. This leads to the unintentional behaviour…
-1
votes
2 answers

Trouble with own C++ list class implementation (insert function)

I'm about to implement my own elementary data structures. Here is a class of list. I'm in struggle to fix the insert(int data) . Idea: each element has a value and 3 pointer: pointer1: head: Points to the head cell pointer2: current: Points to…
Mostafa_M
  • 105
  • 7
-1
votes
1 answer

Is hacking an app config value as a default parameter a code smell?

I'm trying to use App.config and Configuration Manager for the first time. I wanted to use some values in App.config as default parameters for some methods, but this results in an error (not a compile time constant): public void…
eriyg
  • 99
  • 1
  • 12
-1
votes
3 answers

Spring Boot SpEL and configuration property binding to constant expressions

Using Sprint Boot 2.0.4.RELEASE, I have the following properties class (simplified): @Configuration @EnableConfigurationProperties(MyOtherHierarchicalNonConstantProperties.class) public class AppConfiguration { public static final String…
Snackoverflow
  • 5,332
  • 7
  • 39
  • 69
-1
votes
2 answers

Why doesn't Debug.WriteLine work without the DEBUG constant?

I ran into an issue where someone had apparently disabled the DEBUG and TRACE constants on a C# .NET project I was working on, so my calls to Debug.WriteLine were having no effect. (No debug output was shown in the output.) After re-enabling them as…
jpmc26
  • 28,463
  • 14
  • 94
  • 146
-1
votes
1 answer

What is a compile time constant expression in Java?

I have read that final variables in Java should be instantiated to compile time constant expression. I couldn't understand what is compile time constant expression. class A { int i; int j = i * 5; } Is `i * 5 a compile time constant…
Sandeep
  • 9
  • 3
-1
votes
2 answers

Is there a preprocessor macro which lets me know whether an application is of console type or other?

I'm going to write me a little print( ) function. However in said function I'll have to determine whether I'm dealing with a console application independent of the Operating System. ( Mostly for deciding whether to use std::cout or go with the OS…
deW1
  • 5,562
  • 10
  • 38
  • 54
-1
votes
2 answers

How to make a variable using date() constant througout the code ? (php, drupal)

I have a time problem. I'm making a karaoke website were I use php for certain operations. The site is made with Drupal. My problem is that I'm using date() to make a file name of the song that is recorded. But this file name is used in two places…
-2
votes
1 answer

Constant value in Verilog

How to define a constant value for addition in verilog, for example if I define a value A=64'h000000000000001; use it later for addition how should I define in verilog.
-2
votes
1 answer

Template requires compile-time const value

folks. I have a situation like, template argument depends in running time. My function: string DecToBin(int num) { bitset<(num < 256 ? 8 : 32)> bits(num); return bits.to_string(); } So, it cannot be compile for sure. What a solution can…
-2
votes
2 answers

Why it is not compile time constant?

final int i=10; final String s=new String("lkj"); Why first is compile time constant but second is not compile time constant even if final is used with second one as well?
1 2 3
19
20