Questions tagged [qualifiers]

A qualifier adds an extra "quality", such as specifying volatility or constness of a variable

They're similar to adjectives: "a fickle man", "a volatile int", "an incorruptible lady", "a const double". With or without a qualifier, the variable itself still occupies the same amount of memory, and each bit has the same interpretation or contribution to the state/value. Qualifiers just specify something about how it may be accessed or where it is stored

Credits goes to Tony_D @ What is the meaning of "qualifier"?

211 questions
2
votes
1 answer

how to implicitly convert a foo into a const foo in C++ template?

I'm making my own vector container and I'm trying to implement an iterator that works like the real one, using the C++98 standard. This is homework so I don't want the answer just a hint as to where I should look and what I should learn to be able…
tvanbesi
  • 25
  • 5
2
votes
1 answer

Typesafe @Qualifier for Spring Boot to avoid errors with strings

I was asked (and asked myself) many times, what is the best way to avoid error-prone strings in the Spring Boot @Qualifier annotation. (And of course other annotations.) What is better than spreading @Qualifier("variantABC") or…
Datz
  • 3,156
  • 3
  • 22
  • 50
2
votes
2 answers

Why is there 2 ways to write a Pointer to Constant, but only one way to write Constant Pointers?

A Pointer to Constant can be written in either these two ways: int a = 5; const int* b = &a; /* or */ int const* c = &a; But a Constant Pointer can only be written in this way: int a = 5; int* const b = &a; // const* int c = &a; This will not…
Dan
  • 2,694
  • 1
  • 6
  • 19
2
votes
4 answers

Why does this compiler warning only show for int but not for string? "type qualifiers ignored on function return type"

I am a bit confused about some warnings I get when compiling my C++11 code using mingw64. This is my MWE: class A{ const string name; const int ID; public: A(string name_, int ID_) : name(name_), ID(ID_){ //…
2
votes
1 answer

Use qualifiers in image file names does not work in UWP runtime

I was trying to change image for Theme/HighContrast change in UWP app. I followed the link: tailor-resources But it is not working when I change theme while app is running. It works after app restarting. I followed folder name qualifiers & file name…
Abu Raihan
  • 87
  • 8
2
votes
1 answer

What is the difference between static const int and static int const?

In this answer the OP used: static int const var = 5; in the context of a Conditional Compilation Control. Is there a difference between using static const int and static int const? Like for example: static const int var; vs. static int const…
2
votes
1 answer

org.jboss.weld.exceptions.DeploymentException WELD-001409: Ambiguous dependencies for type X with qualifiers @Default

I followed the doc (https://docs.jboss.org/weld/reference/latest/en-US/html/injection.html) to create qualifiers, now I'm getting a deployment error in wildfly-10.1.0.Final, I red a lot of similar questions on the internet but still no clue. The…
henriwang
  • 123
  • 1
  • 7
2
votes
2 answers

Spring: How to combine @RestClientTest with a RestTemplate with @Qualifier?

I have changed a Spring Boot (2.1.4) service that consumes a RestTemplate to use a @Qualifier. Now my Test (with @RestClientTest and @AutoConfigureWebClient) fails because it can not resolve the bean. How do I fix this? The config: @Bean …
Martin Schröder
  • 4,176
  • 7
  • 47
  • 81
2
votes
2 answers

In C++, do ref-qualifiers express a form of subtyping?

From a programming language theory standpoint, in C++, qualifiers like const and volatile allow to express a form of subtyping, with for example int being a subtype of const int. I was wondering if we could also consider that ref-qualifiers & and &&…
Vincent
  • 57,703
  • 61
  • 205
  • 388
2
votes
3 answers

scope prototype not working

I have the following configuration : @Configuration public class GameConfig { @Bean(name = "redsox") public Team getRedSox() { return new Team("RedSox"); } @Bean(name = "boston") public Team getBoston() { return…
Ida Amit
  • 1,411
  • 2
  • 13
  • 27
2
votes
3 answers

Defining a multi word dataype

C++ has the build-in types such as long long int, unsigend int. Type can be combined with qualifiers, such as const, volatile and mutable. Why is long long int a datatype? Why is it not named longLongInt? How does a multi word datatype work? Can I…
schorsch312
  • 5,553
  • 5
  • 28
  • 57
2
votes
0 answers

Android multiple custom resource files using qualifiers

I have an app where I want to change the text according to a specific property or an option that the user selects. The text is not in another language so I can't use the standard resource qualifiers like values-en, values-nl etc. and switch to it by…
Wirling
  • 4,810
  • 3
  • 48
  • 78
2
votes
1 answer

How to open layout according to Country in android?

In android studio while creating a layout,we can select Qualifiers like for different screen size devices we select Ratio for large screen,small screen,etc., and according to screen size, android will take care of it to use these layouts. Now, my…
Ranjan
  • 1,326
  • 18
  • 38
2
votes
2 answers

Stopping the method from calling :after

Say I have a code setup like the one below (defgeneric move (ship destination)) (defmethod move (ship destination) ;; do some fuel calculation here ) (defmethod move :after ((ship ship) (dest station)) ;; do things specific to landing on a…
Electric Coffee
  • 11,733
  • 9
  • 70
  • 131
2
votes
1 answer

How to add `this` qualifier to Java fields in Eclipse?

Is there any functionality in Eclipse to refactor my code such that unqualified field accesses gain the this qualifier? For example, I had been writing some of my code in static methods but would now like to change them to non-static methods. I…
Kyzderp
  • 326
  • 2
  • 9