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
8
votes
2 answers

cv-qualifier propagation in structured binding

As quoted in dcl.struct.bind, Let cv denote the cv-qualifiers in the decl-specifier-seq. Designating the non-static data members of E as m 0 , m 1 , m 2 , ... (in declaration order), each v i is the name of an lvalue that refers to the member m i…
Nimrod
  • 2,908
  • 9
  • 20
8
votes
2 answers

Kotlin + Dagger2: cannot be provided without an @Inject constructor or from an @Provides- or @Produces-annotated method

I'm getting the following error: Error:(8, 1) error: java.lang.String cannot be provided without an @Inject constructor or from an @Provides- or @Produces-annotated method. I'm stuck trying to make a module that provides two qualified Strings.…
crgarridos
  • 8,758
  • 3
  • 49
  • 61
8
votes
3 answers

Overload resolution and shared pointers to const

I'm converting a large code to use custom shared pointers instead of raw pointers. I have a problem with overload resolution. Consider this example: #include struct A {}; struct B : public A {}; void f(const A*) { std::cout <<…
8
votes
0 answers

android build tool adds v4 qualifier to drawable folders by default in generated apk

I have been confused for quite a long time. before build tool v21.0.0, the packaged apk contains the drawable folder structure as below: res/drawable-hdpi res/drawable-ldpi res/drawable-mdpi res/drawable-hdpi However, things changed since v21.0.0,…
Panda World
  • 1,704
  • 1
  • 20
  • 28
8
votes
3 answers

How to get the qualifiers for a given resource (when using it)?

I have a very simple question: Given a specific resource (id,string,drawable,...) from R.java file, is it possible to know which qualifiers it had on its folder that matched it? If so, how ? For example, if my device has a screen with hdpi density ,…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
7
votes
5 answers

C++ type qualifier problem

As part of my Computer Software Development degree, one of my labs consists of creating a calculator class template and a fraction class. The problem is with my fraction class. My task is now to overload the plus operator to allow two fractions to…
Lee
  • 3,869
  • 12
  • 45
  • 65
7
votes
2 answers

C++0x | Why std::atomic overloads each method with the volatile-qualifier?

The following excerpt from the current draft shows what I mean: namespace std { typedef struct atomic_bool { bool is_lock_free() const volatile; bool is_lock_free() const; void store(bool, memory_order =…
0xbadf00d
  • 17,405
  • 15
  • 67
  • 107
7
votes
2 answers

What is the purpose of const qualifier if I can modify it through a pointer in C?

Possible Duplicate: Does the evil cast get trumped by the evil compiler? Hello, If I can modify a constant through a pointer, then what is the purpose of it? Below is code: #include #include int main() { const int a =…
infinitloop
  • 2,863
  • 7
  • 38
  • 55
7
votes
1 answer

candidate function not viable: 1st argument ('const Node *') would lose const qualifier

I am writing a DiGraph (directed graph) class with the c++ built in unordered_map> data structure, where Node and Edge are two structs I defined myself. And in the class I wrote a containsNode() method to search if a Node…
Kevin King
  • 71
  • 1
  • 1
  • 2
7
votes
1 answer

What is the purpose of a UML Qualifier?

I can't understand what a qualifier is in UML. For example, in the scanned page, there's a qualifier named "SharedRegister" that has "state" and "plateNumber" in it. Why not just used a class called SharerRegister and put "state" and "plateNumber"…
David
  • 15,652
  • 26
  • 115
  • 156
6
votes
1 answer

Create interceptor qualifier thats ignore annotation value()

Is there a way to create a interceptor qualifier annotation that ignores the annotation string value for qualifying? for example: Log.java @Inherited @InterceptorBinding @Target({ElementType.METHOD,…
ethanxyz_0
  • 713
  • 12
  • 37
6
votes
2 answers

C++98/03 reference collapsing and cv qualifiers

The code below compiles (gcc 4.7.2 or icc 13) and produces "1 2" output. Which means that const qualifier is dropped, i. e., f has the parameter type int&. Why does it happen? As I understand, according to §14.3.1.4: If a template-argument…
user2052436
  • 4,321
  • 1
  • 25
  • 46
5
votes
2 answers

Type Qualifiers for a device class in CUDA

I'm currently attempting to make a piece of CUDA code with a class that will be used solely on the device side (i.e. host doesn't need to know of it's existence). However I cannot work out the correct qualifiers for the class (deviceclass…
Phil
  • 1,110
  • 1
  • 9
  • 25
5
votes
2 answers

Why is the const qualifier in this type alias dropped?

TL;DR Given the following type: struct A { std::vector vec; using reference = std::iterator_traits::reference; using const_reference = const reference; }; Why is reference == const_reference? Why…
Timo
  • 9,269
  • 2
  • 28
  • 58
5
votes
2 answers

Spring-Boot ignores @Qualifier annotation

I am migrating an active Spring web app to spring boot(1.4.2). The beans are defined in an XML as it is being loaded with @ImportResource. 4 of the beans that I am starting are an instance of the same object BasicDataSource. To tell spring which one…
Ronco
  • 109
  • 1
  • 10
1
2
3
14 15