Search Results

Search found 3 results on 1 pages for 'beldaz'.

Page 1/1 | 1 

  • Catch and identify source of browser launch events

    - by beldaz
    My Windows XP computer is exhibiting strange behaviour, launching multiple browser windows, but not to any URL. Initially this was in Firefox, but when I uninstalled it the same happened in IE. Norton 360 detects no malware, and I wonder if there is some application that is accidentally causing the problem. I'd like to diagnose the problem further. It seems that the default browser is being launched by something, so I'd like to work out the culprit. Is there some method (or handy utility) that can catch requests to XP to launch the default browser, and identify the source?

    Read the article

  • C++ visibility of privately inherited typedefs to nested classes

    - by beldaz
    First time on StackOverflow, so please be tolerant. In the following example (apologies for the length) I have tried to isolate some unexpected behaviour I've encountered when using nested classes within a class that privately inherits from another. I've often seen statements to the effect that there is nothing special about a nested class compared to an unnested class, but in this example one can see that a nested class (at least according to GCC 4.4) can see the public typedefs of a class that is privately inherited by the closing class. I appreciate that typdefs are not the same as member data, but I found this behaviour surprising, and I imagine many others would, too. So my question is threefold: Is this standard behaviour? (a decent explanation of why would be very helpful) Can one expect it to work on most modern compilers (i.e., how portable is it)? #include <iostream> class Base { typedef int priv_t; priv_t priv; public: typedef int pub_t; pub_t pub; Base() : priv(0), pub(1) {} }; class PubDerived : public Base { public: // Not allowed since Base::priv is private // void foo() {std::cout << priv << "\n";} class Nested { // Not allowed since Nested has no access to PubDerived member data // void foo() {std::cout << pub << "\n";} // Not allowed since typedef Base::priv_t is private // void bar() {priv_t x=0; std::cout << x << "\n";} }; }; class PrivDerived : private Base { public: // Allowed since Base::pub is public void foo() {std::cout << pub << "\n";} class Nested { public: // Works (gcc 4.4 - see below) void fred() {pub_t x=0; std::cout << x << "\n";} }; }; int main() { // Not allowed since typedef Base::priv_t private // std::cout << PubDerived::priv_t(0) << "\n"; // Allowed since typedef Base::pub_t is inaccessible std::cout << PubDerived::pub_t(0) << "\n"; // Prints 0 // Not allowed since typedef Base::pub_t is inaccessible //std::cout << PrivDerived::pub_t(0) << "\n"; // Works (gcc 4.4) PrivDerived::Nested o; o.fred(); // Prints 0 return 0; }

    Read the article

  • C++ non-member functions for nested template classes

    - by beldaz
    I have been writing several class templates that contain nested iterator classes, for which an equality comparison is required. As I believe is fairly typical, the comparison is performed with a non-member (and non-friend) operator== function. In doing so, my compiler (I'm using Mingw32 GCC 4.4 with flags -O3 -g -Wall) fails to find the function and I have run out of possible reasons. In the rather large block of code below there are three classes: a Base class, a Composed class that holds a Base object, and a Nested class identical to the Composed class except that it is nested within an Outer class. Non-member operator== functions are supplied for each. These classes are in templated and untemplated forms (in their own respective namespaces), with the latter equivalent to the former specialised for unsigned integers. In main, two identical objects for each class are compared. For the untemplated case there is no problem, but for the templated case the compiler fails to find operator==. What's going on? #include <iostream> namespace templated { template<typename T> class Base { T t_; public: explicit Base(const T& t) : t_(t) {} bool equal(const Base& x) const { return x.t_==t_; } }; template<typename T> bool operator==(const Base<T> &x, const Base<T> &y) { return x.equal(y); } template<typename T> class Composed { typedef Base<T> Base_; Base_ base_; public: explicit Composed(const T& t) : base_(t) {} bool equal(const Composed& x) const {return x.base_==base_;} }; template<typename T> bool operator==(const Composed<T> &x, const Composed<T> &y) { return x.equal(y); } template<typename T> class Outer { public: class Nested { typedef Base<T> Base_; Base_ base_; public: explicit Nested(const T& t) : base_(t) {} bool equal(const Nested& x) const {return x.base_==base_;} }; }; template<typename T> bool operator==(const typename Outer<T>::Nested &x, const typename Outer<T>::Nested &y) { return x.equal(y); } } // namespace templated namespace untemplated { class Base { unsigned int t_; public: explicit Base(const unsigned int& t) : t_(t) {} bool equal(const Base& x) const { return x.t_==t_; } }; bool operator==(const Base &x, const Base &y) { return x.equal(y); } class Composed { typedef Base Base_; Base_ base_; public: explicit Composed(const unsigned int& t) : base_(t) {} bool equal(const Composed& x) const {return x.base_==base_;} }; bool operator==(const Composed &x, const Composed &y) { return x.equal(y); } class Outer { public: class Nested { typedef Base Base_; Base_ base_; public: explicit Nested(const unsigned int& t) : base_(t) {} bool equal(const Nested& x) const {return x.base_==base_;} }; }; bool operator==(const Outer::Nested &x, const Outer::Nested &y) { return x.equal(y); } } // namespace untemplated int main() { using std::cout; unsigned int testVal=3; { // No templates first typedef untemplated::Base Base_t; Base_t a(testVal); Base_t b(testVal); cout << "a=b=" << testVal << "\n"; cout << "a==b ? " << (a==b ? "TRUE" : "FALSE") << "\n"; typedef untemplated::Composed Composed_t; Composed_t c(testVal); Composed_t d(testVal); cout << "c=d=" << testVal << "\n"; cout << "c==d ? " << (c==d ? "TRUE" : "FALSE") << "\n"; typedef untemplated::Outer::Nested Nested_t; Nested_t e(testVal); Nested_t f(testVal); cout << "e=f=" << testVal << "\n"; cout << "e==f ? " << (e==f ? "TRUE" : "FALSE") << "\n"; } { // Now with templates typedef templated::Base<unsigned int> Base_t; Base_t a(testVal); Base_t b(testVal); cout << "a=b=" << testVal << "\n"; cout << "a==b ? " << (a==b ? "TRUE" : "FALSE") << "\n"; typedef templated::Composed<unsigned int> Composed_t; Composed_t c(testVal); Composed_t d(testVal); cout << "c=d=" << testVal << "\n"; cout << "d==c ? " << (c==d ? "TRUE" : "FALSE") << "\n"; typedef templated::Outer<unsigned int>::Nested Nested_t; Nested_t e(testVal); Nested_t f(testVal); cout << "e=f=" << testVal << "\n"; cout << "e==f ? " << (e==f ? "TRUE" : "FALSE") << "\n"; // Above line causes compiler error: // error: no match for 'operator==' in 'e == f' } cout << std::endl; return 0; }

    Read the article

1