CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: babaliaris

Page 1 of 6 1 2 3 4

Search: Search took 0.77 seconds.

  1. Re: Force a friend outside of class declaration?

    Yeap this seems to be the only solution. I checked googletest to see how they do it, and their implementation is excactly like your answer!

    Thank you!
  2. Force a friend outside of class declaration?

    Is it possible to force a class to have a friend class or friend function outside of this class declaration?

    For example



    class MyClass
    {
    . . .
  3. Re: Do header files with implementation work in a precompiled header?

    I have the option Use(/Yu) in the precompiled header options.
    Precompiled header file : pch.h
    Precompiled header source file : <full_path_to>pch.cpp

    In the include direcotries of the...
  4. Re: Do header files with implementation work in a precompiled header?

    Yes, I know that! The thing is that I'm using some quite big header-only libraries and every time I change my code it takes 1 minute to compile.
    And I'm talking about the beginning of a project...
  5. Do header files with implementation work in a precompiled header?

    Let's suppose we have this header file:

    People.h


    class People
    {
    public:
    People(const std::string &name, int age)
    : m_name(name), m_age(age)
  6. Code abstraction using the preprocessor vs interfaces?

    Let's assume you're building a game and you want to have a Window class which it's implementation differs on different platforms.
    I have seen two ways to achieve this. One is by wrapping each...
  7. Re: Casting references VS Casting the mem address of that reference?

    LOL, I thought dynamic cast would fail on a downcast and work only for upcasts. Is it the other way around?
  8. Casting references VS Casting the mem address of that reference?

    If you want to cast a reference you usually do this:



    Subclass &myref = (Subclass&)base_class_object_ref;


    But I have also seen people doing this:
  9. Re: Copy constructor does not get called when assigning reference to a non reference

    Never mind my mistake... The reason wasn't the copy constructor. In the Dispatcher(Event &e) I was passing an instance of MouseMovedEvent which is a subclass of Event.
    But because inside the...
  10. [RESOLVED] Copy constructor does not get called when assigning reference to a non reference var!

    class Dispatcher
    {

    //Dispatcher callback.
    template<typename T>
    using DispatchCallback = std::function<void(T&)>;



    public:
  11. Re: Why does this simple file read method does not work?

    Haha, I just figured it out! Yeah, that was the problem! I was trying to std::cout << returned_string << std::endl . I thought that the result would display zero but apparently it does not work ...
  12. Re: Why does this simple file read method does not work?

    I did it but the issue was not fixed...

    By the way if I remove the line:


    //Set exception mask for file stream.
    file.exceptions(std::ifstream::failbit | std::ifstream::badbit);


    then this...
  13. Why does this simple file read method does not work?

    std::string Program::readFile(const char* path)
    {

    //Variables.
    std::ifstream file;
    std::string content;

    //Set exception mask for file stream.
    file.exceptions(std::ifstream::failbit |...
  14. Re: MBR bootloader segments initialization problem!

    I figured it out.

    The problem is that when I'm referencing a memory address like this:



    by default, the data segment register is being used to do the segment - offset calculation. For...
  15. [RESOLVED] MBR bootloader segments initialization problem!

    I'm compiling using
    nasm -f bin
    I'm running the bootloader using
    qemu-system-x86_64

    I have 2 versions of the same code with a slight change to the second version. First version uses the [org...
  16. Re: [vsCode and gdb]: Breakpoints don't work with macros?

    I'm already using others, like google test. Just for fun and knowledge I'm creating my own. Google test also uses global variables to achieve that.
  17. Re: Templates: Generic Linked List, I stuck at returning type in template functions.

    I fixed the remove method. (Yes I wasn't handling the disconnection of the deleted node from the list).

    Well about the for loop, it works if the size does not change. if you do something like...
  18. Re: [vsCode and gdb]: Breakpoints don't work with macros?

    I understand now. Well, I'm trying to figure another implementation which googletest follows and I think it will work.



    #include <iostream>
    #include <ctime>
    #include <vector>


    #define...
  19. [vsCode and gdb]: Breakpoints don't work with macros?

    Hello!

    I made a unit testing framework and for the first time, I noticed that breakpoints won't work with macros. This is how my tests look like:


    main.cpp


    #include <VampTest/VampTest.h>...
  20. Re: Templates: Generic Linked List, I stuck at returning type in template functions.

    This is my current implementation and it works quite well.



    #ifndef VMPS_LINKEDLIST_HPP
    #define VMPS_LINKEDLIST_HPP
    #include <iostream>

    namespace VMPS
    {
  21. Re: Templates: Generic Linked List, I stuck at returning type in template functions.

    I think I get the idea now. Tell me if I understood it correctly :D

    Something like this (code did not tested):
    User's Code:



    //The other must be the same type as the search method template....
  22. Re: Templates: Generic Linked List, I stuck at returning type in template functions.

    source of the above quote

    Ok, I searched c++ iterators on the internet and found this. I'm new to STL and I didn't know that. Thank you for pointing me in the right direction. I'm off my way...
  23. Re: Templates: Generic Linked List, I stuck at returning type in template functions.

    I just tried and my eyes popped out :d
  24. Templates: Generic Linked List, I stuck at returning type in template functions.

    Hello.

    Until now, I used to do things the old way (As I learned in the java course). For example, in order to create a generic linked list, I would create a Node class which the user can inherit...
  25. Re: Wanings logging system when trying to access freed memory?

    Actually, can I inherit smart pointers to extend them?
Results 1 to 25 of 130
Page 1 of 6 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)