explicit

Format Table Variable Output with FOR XML AUTO

三世轮回 提交于 2019-12-24 06:00:18
问题 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 Xml Auto , Type , Root('testMessage') I get XML that looks like this: <testMessage> <_x0040_testsToRun testsId="10" /> </testMessage> When what I actually want is: <testMessage> <testsToRun testsId="10" /> </testMessage> If the row source is a table

Explicit C# interface implementation of interfaces that inherit from other interfaces

青春壹個敷衍的年華 提交于 2019-12-23 12:45:36
问题 Consider the following three interfaces: interface IBaseInterface { event EventHandler SomeEvent; } interface IInterface1 : IBaseInterface { ... } interface IInterface2 : IBaseInterface { ... } Now consider the following class that implements both IInterface1 and IInterface 2: class Foo : IInterface1, IInterface2 { event EventHandler IInterface1.SomeEvent { add { ... } remove { ... } } event EventHandler IInterface2.SomeEvent { add { ... } remove { ... } } } This results in an error because

SoundCloud Android explicit Intent sharing does not work anymore

可紊 提交于 2019-12-23 05:28:18
问题 Since the latest SoundCloud App update on Android, the explicit intent sharing (from other app) does not work anymore. Instead of showing the share page (which is normally called by the intent), it starts to record audio over the microphone, which is definitely wrong. I checked developers.soundcloud.com, there's neither a sign that explicit intent sharing is no longer support, nor anything else in that direction. So it looks more like a major bug in the latest SoundCloud update on Android.

Defining explicit casting for generic types in C#

て烟熏妆下的殇ゞ 提交于 2019-12-22 12:27:25
问题 As part of an exercise I am trying to define a specific behavior for a generic class when used with a specific type. More precisely, I was wondering if it is possible to define a explicit casting operator for a generic type, i.e. from list<T> to int[] No, I know I could simply define a method that does the work, however this is not the goal of the exercise. Assuming the generic class list<T> I was trying to define the following explicit casting method class list<T> { ... public static

Explicit template specialization

女生的网名这么多〃 提交于 2019-12-22 10:26:41
问题 I hate to ask such a general question, but the following code is a exercise in explicit template specialization. I keep getting the error: c:\users\***\documents\visual studio 2010\projects\template array\template array\array.h(49): error C2910: 'Array::{ctor}' : cannot be explicitly specialized #ifndef ARRAY_H #define ARRAY_H template <typename t>` class Array { public: Array(int); int getSize() { return size; } void setSize(int s) { size = s; } void setArray(int place, t value) { myArray

Android Explicit Intent throws NoClassDefFound error

青春壹個敷衍的年華 提交于 2019-12-22 05:17:23
问题 I'm trying to use an explicit intent to display a MapView in my android app. Although I don't see anything wrong with my code, I keep getting a "NoClassDefFoundError" when I try to start my activity. Basically, from my main activity (SetCriteria), I create the explicit intent when user presses a button : Log.i(TAG, "Showing map.."); try{ Intent intentMap = new Intent(view.getContext(), AddLocation.class); startActivity(intentMap); }catch(Throwable ex) { Log.e(TAG, "Error occured while trying

Explicit Assignment vs Implicit Assignment

南楼画角 提交于 2019-12-20 10:36:44
问题 I'm reading a tutorial for C++ but it didn't actually give me a difference (besides syntax) between the two. Here is a quote from the tutorial. You can also assign values to your variables upon declaration. When we assign values to a variable using the assignment operator (equals sign), it’s called an explicit assignment: int nValue = 5; // explicit assignment You can also assign values to variables using an implicit assignment: int nValue(5); // implicit assignment Even though implicit

explicit copy constructor ignored even if exact argument was provided

拟墨画扇 提交于 2019-12-20 04:50:01
问题 The copy constructor has been provided. While using it exactly same type is passed to argument. Still the it seems the compiler( gcc/g++ 4.8.2) ignores existence of explicit copy constructor. The code generates compilation error. Why? The error is: t.cpp: In function ‘A f(const A&)’: t.cpp:19:12: error: no matching function for call to ‘A::A(const A&)’ return a; //compilation error with gcc 4.8.2 ^ t.cpp:19:12: note: candidate is: t.cpp:14:5: note: A::A() A(){} ^ t.cpp:14:5: note: candidate

Is it possible to infer template parameters of tuple from brace-type initialization?

房东的猫 提交于 2019-12-18 17:11:34
问题 In this example, is it possible to allow the deduction of the template parameters type of the tuple ? #include<tuple> #include<string> template<class T1, class T2> void fun(std::tuple<T1, T2> t, std::string other){} int main(){ fun(std::tuple<double, int>(2.,3), std::string("other")); // ok fun(std::make_tuple(2.,3), std::string("other")); // ok, but trying to avoid `make_tuple` fun({2.,3},std::string("other")); // desired syntax but // giving compilation error: candidate template ignored:

Purpose of Explicit Default Constructors

故事扮演 提交于 2019-12-17 17:48:12
问题 I recently noticed a class in C++0x that calls for an explicit default constructor. However, I'm failing to come up with a scenario in which a default constructor can be called implicitly. It seems like a rather pointless specifier. I thought maybe it would disallow Class c; in favor of Class c = Class(); but that does not appear to be the case. Some relevant quotes from the C++0x FCD, since it is easier for me to navigate [similar text exists in C++03, if not in the same places] 12.3.1.3