using-directives

What does “using namespace” do exactly?

核能气质少年 提交于 2021-02-16 05:49:12
问题 The following C++ test code does not link (gcc 4.9.2, binutils 2.25). The error is In function 'main': undefined reference to 'X::test' . 01: #include <string> 02: #include <iostream> 03: 04: namespace X 05: { 06: extern std::string test; 07: }; 08: 09: using namespace X; 10: std::string test = "Test"; 11: 12: int main() 13: { 14: std::cout << X::test << std::endl; 15: } Because of line 09, I was expecting line 10 to define the X::test variable declared on line 06. I believe that instead an

What does “using namespace” do exactly?

╄→гoц情女王★ 提交于 2021-02-16 05:48:05
问题 The following C++ test code does not link (gcc 4.9.2, binutils 2.25). The error is In function 'main': undefined reference to 'X::test' . 01: #include <string> 02: #include <iostream> 03: 04: namespace X 05: { 06: extern std::string test; 07: }; 08: 09: using namespace X; 10: std::string test = "Test"; 11: 12: int main() 13: { 14: std::cout << X::test << std::endl; 15: } Because of line 09, I was expecting line 10 to define the X::test variable declared on line 06. I believe that instead an

C# using system.io not woking in my class but works in main

我是研究僧i 提交于 2020-04-06 22:25:07
问题 I am working on an issue I do not remember ever having before. I am using VS2012 C# When i add using System.IO ; to my main program everything works fine, however when I add it to my class file it will not let me use all of the methods. using System; using System.Collections.Generic; using System.IO; using System.Data.SQLite; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FoxySearch { class FoxySearch { File. <<<<----- here i want to add File.Exists("Blablalba")

Converting GCC assembly code to armasm assembly code

泄露秘密 提交于 2020-01-24 21:16:48
问题 I am trying to convert GCC assembly code to ARMASM assembly code can anyone please help me with this. The main problem is .req .unreq .qn.dn . I wanted to know the equivalents of the above directives. I tried ALIAS it did not work. .align 4 .global ne10_fir_float_neon .extern ne10_qMaskTable32 .thumb .thumb_func ne10_fir_float_neon: PUSH {r4-r12,lr} @push r12: to keep stack 8 bytes aligned @/*ARM Registers*/ pStateStruct .req R0 pSrc .req R1 pDst .req R2 blockSize .req R3 pState .req R4 @/*

Are all using directives viewed the same way as using namespace std?

一个人想着一个人 提交于 2020-01-07 08:31:56
问题 I've easily gotten myself into the habit of prefixing standard identifiers with std:: instead of sticking in a using namespace std; . However, I've started getting into C# and I've noticed that it's very normal to add in whatever using directives are necessary, i.e., you'd see: using System; Console.Write("foo"); instead of: System.Console.Write("foo"); Apparently, as I found out from a C# question on this topic, that usage comes from the fact that individual system namespaces in C# are much,

Global “using” directives in VS2010/C#?

半腔热情 提交于 2020-01-03 11:29:19
问题 I'm pretty sure I know the answer but I'm wondering if there's a way to define a global "using" directive in my C# projects so that I don't have to repeat the directive on top of every code file. My interest is really rooted with the introduction of extension methods in the .NET Framework. The only way to use an extension method is to define a using directive for the namespace containing the extension methods. Without the using directive, I lose Intellisense capabilities for the extension

How to properly bind scope between directive and controller with angularJS

老子叫甜甜 提交于 2019-12-31 10:48:10
问题 I'm trying to generate an n-level hierarchical unordered list with anugularJS, and have been able to successfully do so. But now, I'm having scope issues between the directive and controller. I need to change a scope property of the parent from within a function called via ng-click in the directive template. See http://jsfiddle.net/ahonaker/ADukg/2046/ - here's the JS var app = angular.module('myApp', []); //myApp.directive('myDirective', function() {}); //myApp.factory('myService', function(

What does the using directive do, exactly?

谁都会走 提交于 2019-12-30 18:47:29
问题 On MSDN I can read what it does, but I would like to know what it does technically (tells compiler where to look for types..)? I mean using as a directive. 回答1: The primary function of the using directive is to make types within a namespace available without qualification to the user code. It considers the set of namespaces and types which are defined in referenced assemblies and the project being compiled. Take for example the following definition in MyTypes.Dll namespace MyTypes { class

Type or namespace name could not be found (missing using directive or assembly reference?)

大憨熊 提交于 2019-12-25 08:08:53
问题 With this code: using System.Web.Http; class MyClass : IHttpActionResult { ... } I get the error: The type or namespace name 'IHttpActionResult' could not be found (are you missing a using directive or an assembly reference?) As shown here, the IHttpActionResult interface is defined in System.Web.Http . What is wrong? 回答1: Fixed this problem (strictly related to this one) specifying in Project > Reference Manager: Microsoft.Owin 2.0.2.0 Owin 1.0.0.0 System.Net.Http.Formatting 5.2.3.0 System

Interpretation of [basic.scope.hiding]p2 when unqualified name lookup involves using-directives

大兔子大兔子 提交于 2019-12-23 12:13:26
问题 There are two types of name hiding in c++: 1) Normal name hiding: [basic.scope.hiding]p1 (http://eel.is/c++draft/basic.scope.hiding#1): A name can be hidden by an explicit declaration of that same name in a nested declarative region or derived class ([class.member.lookup]). 2) The special type of name hiding in [basic.scope.hiding]p2 (http://eel.is/c++draft/basic.scope.hiding#2): A class name ([class.name]) or enumeration name ([dcl.enum]) can be hidden by the name of a variable, data member,