Search:

Type: Posts; User: jinhao

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. Generally speaking, if we provide a framework and...

    Generally speaking, if we provide a framework and accept the exterior defined actions. like this.


    template<typename Iterator, typename Functor>
    Functor for_each(Iterator beg, Iterator end,...
  2. Nana provides a template like std::function...

    Nana provides a template like std::function called nana::functor, the library uses this template for convenience and agility. For example.


    void foo();

    struct T
    {
    void foo();
    };
  3. Functor is not a function, but it can be invoked...

    Functor is not a function, but it can be invoked by function-call syntax. So, we should not take care about whether it is a function, and it is a good solution to be a substitute for pointer to...
  4. Qt says a callback is a pointer to function, but...

    Qt says a callback is a pointer to function, but IMO, callback is more like a pattern that is a implememtion of Dependency Injection.
    nowadays, we have function objects.
  5. I have not used Qt - -! Qt is very powerful,...

    I have not used Qt - -!
    Qt is very powerful, Nana is lightweight.
    Qt has its own syntax, Nana uses standard C++.

    In fact, the main aim of Nana is providing comman concepts for programming, it...
  6. Try the free C++ GUI library for your hobby project.

    Try the Nana C++ Library for your hobby project. It's free and open-source.

    This is a pure C++ library written in standard C++, it makes you create a GUI program faster through HAND-CODING :devil:
  7. Replies
    12
    Views
    1,461

    In fact, move constrictor is not a substitute for...

    In fact, move constrictor is not a substitute for copy constrcutor. Don't forget copy constrictor if there is a deep copy.
  8. Replies
    12
    Views
    1,461

    yes, but it is not necessary using std::move()...

    yes, but it is not necessary using std::move() with bar, because bar is a POD type.
  9. Replies
    12
    Views
    1,461

    es, it is "dangling" reference that return a...

    es, it is "dangling" reference that return a reference to a local object.
    The copy constructor of Matrix would not be invoked, because you give a move constructor. But the move constructor you...
  10. Replies
    12
    Views
    1,461

    Matrix::Matrix(Matrix&& rhs): ...

    Matrix::Matrix(Matrix&& rhs):
    data(std::move(rhs.data)),
    rows(std::move(rhs.rows)),
    cols(std::move(rhs.cols))
    {
    }

    Matrix aPlusB(a+b); //aPlus is moved from the temp object.
  11. Replies
    11
    Views
    4,533

    Thank you very much :D

    Thank you very much :D
  12. Replies
    11
    Views
    4,533

    yes, but this nana is not GNU nana, I am so...

    yes, but this nana is not GNU nana, I am so appreciated that you read the document, would you please give me some feedbacks? :-)
  13. Replies
    11
    Views
    4,533

    There is an alternate candidate :-) Nana C++...

    There is an alternate candidate :-) Nana C++ Library, a GUI framework, it's written in Standard C++ and a pure C++ style. There is a picture about a program that powered by the Nana library.
    11034...
  14. Replies
    12
    Views
    1,368

    for(int i = 0; i < 1024 * 1024 * 1024; ++i) ...

    for(int i = 0; i < 1024 * 1024 * 1024; ++i)
    g_buffer[i] = 0;

    This snippet of code is real a performance killer. There are some goods way to do it


    const size_t size = 1024 * 1024 *...
  15. I have no idea what your purpose is. If it is a...

    I have no idea what your purpose is. If it is a weak-type interpreter, the polymorphism method is a better solution to this suituation.

    >>Only literals and identifiers need to work with (by that...
  16. class Literal : public token { public: ...

    class Literal : public token
    {
    public:
    Literal(const std::string & str)
    {
    num_ = str to number;
    }

    int number() const { return num_; }
    private:
  17. Thread: Callback style

    by jinhao
    Replies
    7
    Views
    1,358

    You can give an interface. class...

    You can give an interface.




    class CSAZVariable : public CSAZNamedType
    {
    public:
    class var_interface
    {
  18. Replies
    4
    Views
    1,048

    In my opinion, it makes sense. class T {...

    In my opinion, it makes sense.



    class T
    {
    public:
    int foo();
    };
  19. Replies
    2
    Views
    833

    the age in main body refers to the global...

    the age in main body refers to the global variable age, after the statement age = age + 2; the value after process is 22. If you still use age in somewhere else after process, the value is still 22.
  20. Replies
    8
    Views
    1,749

    void RunTutorial(tutorial* t) { //do some stuff...

    void RunTutorial(tutorial* t) {
    //do some stuff to run t
    delete t;
    //...
    }


    To delete object of tutorial__ext_ray_trace correctly, you should declare the destructor of class tutorial as a...
  21. Using a nest class and its constructor ...

    Using a nest class and its constructor



    class T
    {
    struct unique_tag
    {
    const int x;
  22. Replies
    117
    Views
    82,074

    I hate politics!!!!

    I hate politics!!!!
  23. Replies
    117
    Views
    82,074

    Every language has its own history and culture,...

    Every language has its own history and culture, even that was lost or is going to be lost.
    Chinese character is very interesting, e.g, 水(water) it's hieroglyphic, this chararcter looks like water...
  24. Replies
    117
    Views
    82,074

    Do not confuse the Great China Famine with The...

    Do not confuse the Great China Famine with The Holocaust.

    For the wrong mistake, the goverment of China was not able to save these people, the grain lacked!

    If you think a policy error is as...
  25. Replies
    117
    Views
    82,074

    Tiananmen_Square_protests_of_1989: Do you really...

    Tiananmen_Square_protests_of_1989:
    Do you really know that? The photo shows an unknown man halting the tanks! but the first tank did not hit the man! you can search the video on YouTube.
    Many...
Results 1 to 25 of 127
Page 1 of 6 1 2 3 4