Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
142 views

I have Visual Studio 2022 and this line of code using (Excel.Application xlApp = new Excel.Application()) throws an error CS1674 'Application': type used in a using statement must implement 'System....
Charles Fleischmann's user avatar
1 vote
1 answer
93 views

From cppreference : From the point of view of unqualified name lookup of any name after a using-directive and until the end of the scope in which it appears, every name from namespace-name is visible ...
Rajdeep Sindhu's user avatar
3 votes
1 answer
245 views

I last used C++ at the 98 with boost/C++11 simulation. I am reading Stroustrup's "A Tour of C++, Third Edition" to help introduct the things I will need to learn more about. Following ...
Varsuuk's user avatar
  • 39
0 votes
0 answers
25 views

I have a VS issue, VS2022 but it also happened in the previous version. In fact its been happening for a few years. When I do certain operations, often moving files within VS, I find I get a load of ...
Craig's user avatar
  • 585
1 vote
1 answer
48 views

In the following code will fail to compile because, despite the chain of public inheritance, HasFlag is not visible in DerivedFoo. class BasicFoo { public: bool HasFlag() const { return m_flag; } ...
Adrian McCarthy's user avatar
0 votes
0 answers
37 views

Using the using-directive I'm able to select a certain set of methods from the base class to put into a different access scope. Is this also possible for individual overloads of the method? Something ...
glades's user avatar
  • 5,356
0 votes
0 answers
551 views

I have a project with some interfaces that contains some type alias in it, for example like below: namespace UsingTest { using MyType = System.Collections.Generic.List<int>; public ...
sorosh_sabz's user avatar
  • 3,053
2 votes
3 answers
97 views

This is just short inquiry if it is at all possible to somehow import base class constructors without all the template bloat. Consider this example where I'm inheriting from a templated std::variant: ...
glades's user avatar
  • 5,356
16 votes
2 answers
14k views

C#10 in .NET 6.0 supports a new feature called global using directive. It seems to do 2 things: When you have a namespace in the global using, you don't have to include the using ... for that ...
Stefan's user avatar
  • 1,367
1 vote
1 answer
374 views

I have a library - Foo.System.Management I have an application - Foo.New.Application In this application, Using System; is imported, and what ends up happening is this is being resolved to Foo.System ...
Adjit's user avatar
  • 10.3k
-1 votes
1 answer
67 views

Code: #include <stdio.h> #define puts "%s C preprocessor" int main() { printf(puts, puts); return 0; } Output: %s C preprocessor C preprocessor See also... Can anyone explain ...
sakshi monst's user avatar
0 votes
1 answer
99 views

(You might see this question as a duplicate of this, but, to be honest, I've not really understood the matter, so I'm asking separately with my own wording.) [over.load]/1 reads: Not all function ...
Enlico's user avatar
  • 30.2k
1 vote
2 answers
1k views

I am creating a NUnit test project and in the creation of that, MS Visual Studio has created a file called Usings.cs with the line global using NUnit.Framework; which tells the project to include the ...
suitendaal's user avatar
0 votes
0 answers
39 views

I'm currently switching from Java to C++ and I have troubling understaning the following problem. I have a header file for a class (AClass.h): #ifndef ACLASS_H #define ACLASS_H #include <cstdint&...
E_3's user avatar
  • 311
0 votes
2 answers
53 views

Often in derived template classes I need to refer to the base to access members. I end up writing code like this: template<typename A> struct BaseClass { }; template<typename B> struct ...
Heisenbug's user avatar
  • 39.3k
1 vote
2 answers
2k views

My Unity project has the Animation Rigging Package. As we all know if we write a script where we need to reference some kind of Rig we must use the namespace/using direction for this package. Here is ...
Roman Aebi's user avatar
0 votes
2 answers
628 views

In short: I have a base class A_base without template parameters and a derived class A that has two. The function foo() only accepts base class objects foo() is supposed to return an object which has ...
glades's user avatar
  • 5,356
2 votes
1 answer
407 views

I knew that this would be ambiguous #include <boost/hana/fwd/equal.hpp> #include <range/v3/algorithm/equal.hpp> #include <vector> int main() { std::vector<int> v{1,2,3}; ...
Enlico's user avatar
  • 30.2k
2 votes
2 answers
139 views

while trying to implement a metafunction, which needs to exist only if the "abs" function exists for some type, i ran into the folowing problem: Here are two examples of code i would expect ...
J.M's user avatar
  • 337
4 votes
2 answers
3k views

I am reading some code snippets from others and I find a line: using namespace::std; I suspect its purpose is using namespace std;, with some typos. But to my surprise the compiler accepts this code ...
rustyhu's user avatar
  • 2,235
1 vote
3 answers
866 views

No error occurs when using using namespace std; and std::cout together. Can these two be used together? #include <iostream> using namespace std; int main() { std::cout << "...
kev's user avatar
  • 19
1 vote
2 answers
166 views

I have come to understand why using namespace std; is considered bad practice in c++ but let's consider for example 2 ( hypothetical ) libraries "std" and "sfd" , both of them ...
Ken Za's user avatar
  • 81
1 vote
2 answers
138 views

using namespace X; cout << var; using Y::var; cout << var; So say I have a namespace X and a namespace Y that both contain a variable of type int called var. When I say using ...
jaylse2's user avatar
  • 71
1 vote
1 answer
334 views

To understand more using directives and function overloading I've tried this program: namespace ns{ void f(int){cout << "int\n";} void f(double){cout << "double\n&...
Itachi Uchiwa's user avatar
2 votes
1 answer
106 views

this program works correctly but when I separate that "Class StudentsName" and put it on the header file it doesn't work correctly. I add the header file in my project by right click on the ...
asipoolika's user avatar

1
2 3 4 5 6