static

How can i list and watch all global variables on watch windows of visual studio (for c++)?

When stopped at a breakpoint on main(), i can manually add name of a global variables to watch windows, but what i want is how to show a list of all global variables, because i'm using an external library, which contains many static things. Is it possible? Thanks in advance! ...

Do static local variables in a class persist between objects?

class MyClass { static int staticInt; void instanceMethod( int param ) { static int parameter = param; } } Clearly staticInt is shared between all instance of MyClass. But can different instances of MyClass have different values of parameter the static local variable within instaceMethod? Update What about between progr...

Control Reference Static Method Performance

I have just asked which one is better? Static Vs Non-Static? http://stackoverflow.com/questions/3016717/static-vs-non-static-method-performance-c I would like to take this discussion one step ahead. Consider If i pass reference of Panel control as parameter to Public static method, will static method still rules in performance? ...

ActionScript Encapsulating a Static Function

i would simply like to encapsulate a function in it's own .as file, but i can't quite get it. package { public class NumberAdd { public function NumberAdd() { public static function myNumber(val:Number):Number { return val + 2; } } } } this i would call it like th...

BizTalk external assembly namespace and static methods

Is there some restriction in BizTalk 2006 R2 to accessing static methods in external assemblies when the assembly has a "." in the name ? I have the solution set-up with the BizTalk project "FooBar", and the external assembly project "FooBar.Helper" (strongly signed and GAC'ed) with a class "Demo" (public and serializable), which is ref...

Static struct in C++

Hi, I want to define an structure, where some math constants would be stored. Here what I've got now: struct consts { //salt density kg/m3 static const double gamma; }; const double consts::gamma = 2350; It works fine, but there would be more than 10 floating point constants, so I doesn't want to wrote 'static const' before ...

Static DB Provider in ASP.NET MVC Causing Memory Leak

Hi, I have got an app I'm going to write in ASP.NET MVC and I want to create a DatabaseFactory object something like this:- public class DatabaseFactory { private string dbConn get { return <gets from config file>; } public IDatabaseTableObject GetDatabaseTable() { IDatabaseTableObject databaseTableObject = new SQLDatab...

C++ - defining static const integer members in class definition

My understanding is that C++ allows static const members to be defined inside a class so long as it's an integer type. Why, then, does the following code give me a linker error? #include <algorithm> #include <iostream> class test { public: static const int N = 10; }; int main() { std::cout << test::N << "\n"; std::min(9, ...

Boost Test dynamically or statically linked?

We use Boost statically linked with our app but now I wan't to use Boost Test with an external test runner and that requires the tests themselves to link dynamically with Boost.Test through the use of the required BOOST_TEST_DYN_LINK define. Is this going to be a problem or is the way Boost Test links completely unrelated to the way the...

static initialization order fiasco

I was reading about SIOF from a book and it gave an example : //file1.cpp extern int y; int x=y+1; //file2.cpp extern int x; int y=x+1; Now My question is : In above code..will following things happen ? 1. while compiling file1.cpp, compiler leaves y as it is i.e doesn't allocate storage for it. 2. compiler allocates storage for ...

Static Variables in Overloaded Functions

I have a function which does the following: When the function is called and passed a true bool value, it sets a static bool value to true When the function is called and passed a string, if the static bool value is set to true, it will do something with that string Here is my concern -- will a static variable remain the same between ...

static initialization confusion

I am getting very confused in some concepts in c++. For ex: I have following two files //file1.cpp class test { static int s; public: test(){s++;} }; static test t; int test::s=5; //file2.cpp #include<iostream> using namespace std; class test { static int s; public: test(){s++;} static int get() { ...

schwarz counter

The long code below is given in Thinking in C++ by Bruce Eckel //: C10:Initializer.h // Static initialization technique #ifndef INITIALIZER_H #define INITIALIZER_H #include <iostream> extern int x; // Declarations, not definitions extern int y; class Initializer { static int initCount; public: Initializer() { std::cout << "Ini...

Are static members of a generic class tied to the specific instance?

This is more of a documentation than a real question. I noticed the principle it is not described on SO yet (did I miss it?), so here goes: Imagine a generic class that contains a static member: class Foo<T> { public static int member; } Is there a new instance of the member for each specific class, or is there only a single inst...

xsl-fo header - image left, three lines of text right, top aligned

Using apache FOP, want to create a header with a logo aligned left, three-line address aligned right, both aligned top. Following works ok if done inside of flow, but in a static-content header ('xsl-region-before') it gets the left & right correct but aligns the logo below the address block, as if the table definition were being ignore...

static images aren't caching with php-generated page

Our website was just converted to being generated by mod_rewrite and php scripts. Images aren't caching in browsers when they seemingly should be. All images follow format: <img src="/images/header.png" /> I must avoid the script completely caching because the PHP parser needs to handle each page dynamically on each request; however,...

Static CComPtr Variable

Is it bad idea to have static CComPtr member variables in an application. Since we cannt control destruction of static variable and it can happen after CoUninitialze . ...

Class Methods Inheritence

I was told that static methods in java didn't have Inheritance but when I try the following test package test1; public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { TB.ttt(); TB.ttt2(); } } package test1; public class TA { static publi...

C++ private inheritance and static members/types

I am trying to stop a class from being able to convert its 'this' pointer into a pointer of one of its interfaces. I do this by using private inheritance via a middle proxy class. The problem is that I find private inheritance makes all public static members and types of the base class inaccessible to all classes under the inheriting cla...

In C#, can an attribute be applied to a static class, method or property?

Hi there, I was just wondering if an attribute can be applied to a static class, method or property in c#? Like, [MyAttribute] public static MyMethods(string str) ... Thanks Ray. ...