In C++ specifies constructors and conversion operators that don't allow implicit conversions or copy-initialization. In C# declares a user-defined type conversion operator that must be invoked with a cast. For MS SQL Server for-xml-EXPLICIT mode use the [for-xml-explicit] tag
Questions tagged [explicit]
405 questions
2
votes
1 answer
Make method explicit except for friend classes
I am trying to create a conversion operator that would be explicit by default, except for some designated classes.
More precisely, I have a relatively simple class template whose instances should be convertible to some other type (int throughout…

Nelfeal
- 12,593
- 1
- 20
- 39
2
votes
1 answer
Conversion to base class never used
I have two classes, one is privately derived from the other (because I don't want to expose the interface of the base). However later I want to create a reference to the base.
I can do it with a normal member function base() but not with a cast…

alfC
- 14,261
- 4
- 67
- 118
2
votes
0 answers
Why we need explicit exception chaining in Python 3
I have just learned about exception chaining in Python. What I see is, that there are two ways - inplicit and explicit. If I don't do anything special and raise caught exception. Py will automatically save info about previous exception (if I…

user3883586
- 21
- 1
2
votes
5 answers
Can I use the explicit operator to create a derived class?
class Base
{
}
class Derived1 : Base
{
}
class Derived2 : Base
{
public static explicit operator Derived1(Derived2 d2)
{
return new Derived1();
}
}
class Test
{
static void Main()
{
Base bd2 = new Derived2();
…

Budda
- 18,015
- 33
- 124
- 206
2
votes
2 answers
C++ - Deal with implicit/explicit casts while keeping flexible code
I am looking for a way to express interoperability between a class A and built-in integer types while keeping high flexibility in my code. E.g, I would like to be able to use operator & freely between (A and A), (A and int), (int and A) and (int and…

Benjamin Barrois
- 2,566
- 13
- 30
2
votes
0 answers
Make gcc warn for explicit conversions
How can I make gcc (6.3) to warn for all explicit 64bit to 32bit conversions done by casting (C code)?
Explicit conversions are ignored by -Wconversion flag.
I'm about to compile a very big and old project to 64bit and I know that there are many…

IdolAdmin
- 61
- 1
- 5
2
votes
1 answer
General explicit wait - selenium python
I hope this question is unique and will help also other testers.
I need the solution for python selenium.
I need to replace several time.sleep() lines of code, by time explicit waits.
When Chrome sleeps for few seconds before every element which is…

ann
- 113
- 2
- 3
- 9
2
votes
3 answers
How to differentiate implicit/explicit constructor calls in C++?
I'm trying to detect when an explicit constructor call has been called vs. an implicit one.
Suppose we have a class Foo:
class Foo{
public:
Foo(int _val) : val(_val){};
private:
int val;
}
void bar(Foo f){
...
}
We can call bar like:…

OneRaynyDay
- 3,658
- 2
- 23
- 56
2
votes
3 answers
Explicit List cast wrong type?
I'm trying to cast to a List from a result from a stored procedure .. I have already created the explicit (working) cast for a single object of timerangeResult -> Booking, but I am missing a list ..
Here's the code:
public static explicit operator…

dza
- 1,478
- 2
- 13
- 24
2
votes
1 answer
Error defining explicit operator bool() outside class
I have problem defining operator bool() function outside the class
class A{
public:
explicit operator bool() const;
};
I am defining the function outside class as...
explicit A::operator bool() const {
...
}
I get this error - error:…

user3922375
- 49
- 1
- 2
2
votes
1 answer
The explicit keyword in MS Visual Studio 4.1
I am implementing a smart pointer class using generics and I wanted to force users of this class to properly construct the smart pointer using syntax such as
MyReference(mytest3))
or
MyReference mytest4(new TestCls());
so I…

Dennis
- 3,683
- 1
- 21
- 43
2
votes
1 answer
How can I obtain explicit focus via the 'for' attribute on p:focus?
According to the documentation, it should be possible to explicitly declare that a form input
element component receives focus via the 'for' attribute.
In this case, the second visible and enabled input element rather than the first by default -…

Dart
- 43
- 5
2
votes
1 answer
What is the effect of 'explicit' keyword on the Return Value Optimization (RVO)?
Following code works perfectly fine (showing RVO):
struct A {
A (int) { cout << "A::A()\n"; } // constructor
A (const A&) { cout << "A::A(const A&)\n"; } // copy constructor
};
A foo () { return A(0); }
int main () {
A a =…

iammilind
- 68,093
- 33
- 169
- 336
2
votes
3 answers
Python, unable to convert input() to int()
I am trying to convert input() data to int() with the following code:
prompt_text = "Enter a number: "
try:
user_num = int(input(prompt_text))
except ValueError:
print("Error")
for i in range(1,10):
print(i, " times ", user_num, " is ",…

Georgi Tsvetanov Tsenov
- 321
- 3
- 13
2
votes
3 answers
Format Table Variable Output with FOR XML AUTO
Using SQL Server 2008.
I have a table variable with a single column and single row.
If I do this:
Declare @testsToRun Table ( testsId BigInt )
Insert Into @testsToRun
Select testsId From tests Where testsId = 10
Select Top 1 * From @testsToRun
For…

Snowy
- 5,942
- 19
- 65
- 119