Search:

Type: Posts; User: frank67

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    658

    trailing return from std::tuple

    Hi,
    I'm on C++11, is it possible from decltype to determine which type the call operator must use as return type from std::tuple? The testing code:

    #include <iostream>
    #include <tuple>

    using...
  2. Thanks for your answer, but memory leak happens...

    Thanks for your answer, but memory leak happens the same if not catch:

    #include <iostream>

    void exercise()
    {
    throw 1; // memory leak
    }

    int main()
  3. memory leak detected when throwing exception

    Hi,
    I'm trying to throw an exception without a memory leak happens.
    Googling I found this FAQ:
    https://isocpp.org/wiki/faq/exceptions#why-not-exceptions
    where I read: "Throwing an exception will...
  4. Replies
    3
    Views
    889

    Do you mean that way? #include ...

    Do you mean that way?

    #include <iostream>
    #include <vector>
    #include <iterator>

    using namespace std;

    struct istream_si
    {
  5. Replies
    3
    Views
    889

    pair type and operator>>

    What's wrong about this source code?

    #include <iostream>
    #include <vector>
    #include <iterator>

    using namespace std;

    int main()
    {
  6. Replies
    2
    Views
    580

    I'm grateful with you to enlighten me with your...

    I'm grateful with you to enlighten me with your answers :) I carefully read the post and as a consequence of this sentence:

    Googling I discovered that cppreference says since C++11...
  7. Replies
    2
    Views
    580

    apropos converting constructor

    I'm a bit confused when trying to figure out the implementation of a converting ctor. I wrote this source:

    #include <iostream>
    #include <stdexcept>

    using namespace std;

    class tinyInt { ...
  8. Maybe I misunderstood the exercise but I chose...

    Maybe I misunderstood the exercise but I chose variadic template as possible solution, now I'm not able to go forward because I don't know how to specialize the variadic for const char* type.
    The...
  9. Specializing a variadic template: C++ Primer ex. 16.64

    I hope to quickly end these exercises:devil:, although it works fine without it has been asked to write a specialization of the variadic template Element_cnt in order to be called for const char*...
  10. Replies
    10
    Views
    2,118

    No, nothing to say it's clear now. Instead could...

    No, nothing to say it's clear now. Instead could I have confirmation about that std::forward act as std::move on t2?
    t2 is bound to the literal 42 that is a rvalue therefore std::forward returning...
  11. Replies
    10
    Views
    2,118

    The number 2 because &j is bound to z passed as...

    The number 2 because &j is bound to z passed as lvalue via std::forward
    Any further comments?
  12. Replies
    10
    Views
    2,118

    Yep! my mistakes (I played with the code too...

    Yep! my mistakes (I played with the code too much:redface:) the definition of g function at line 13 has changed, then I correct the typo at line 10 (thanks Elysia) in second parameter of the function...
  13. Replies
    10
    Views
    2,118

    C++ Primer exercise 16.47

    I'm a bit confused :confused: about type conversions in this exercise so I hope someone will enlighten me. C++ is a statically typed language therefore types must match otherwise conversion rules...
  14. Replies
    12
    Views
    1,330

    I agree, admitting that opensource tools suit my...

    I agree, admitting that opensource tools suit my needs which is a good one? Maybe Qt-Creator, I thought...:frown:
  15. Replies
    12
    Views
    1,330

    I have to buy too many things before to be able...

    I have to buy too many things before to be able to coding with Visual Studio, since C++ is a standard (not proprietary) I think that opensource tools are good enought to accomplish this.
    Me too I...
  16. Replies
    12
    Views
    1,330

    Up to now I'm dealing with the exercises of the...

    Up to now I'm dealing with the exercises of the book C++ Primer maybe it could be helpful in the future, I don't know

    it does

    maybe it does; I should check

    Does your IDE also checks for...
  17. Replies
    12
    Views
    1,330

    I haven't an IDE GUI based I wrote code with...

    I haven't an IDE GUI based I wrote code with Visual IMproved in cascade with valgrind they fit my needs, up to now...:)
    I learned to use static_assert for these matters, with this code:

    #include...
  18. Replies
    12
    Views
    1,330

    The exercise asked for: "Write a version of sum...

    The exercise asked for: "Write a version of sum with a return type that is guaranteed to be large enough to hold the result of the addition."
    Therefore I wrote this code:

    #include <iostream>...
  19. Replies
    12
    Views
    1,330

    Yes, I've already tried typeid but I discarded...

    Yes, I've already tried typeid but I discarded just because it doesn't print a well understandable output for built-in types.
    I guess the only way is to use the is_same class as in this link:...
  20. Replies
    12
    Views
    1,330

    print remove_pointer::type

    I'd like to print remove_pointer::type member's value. This is the code:
    #include <iostream>
    #include <type_traits>

    using namespace std;

    int main()
    {
    unsigned u(1);
    string...
  21. Replies
    2
    Views
    1,460

    :eek: I didn't realize that those were...

    :eek: I didn't realize that those were copy-control members function template, thanks Laserlight!
  22. Replies
    2
    Views
    1,460

    using custom deleter for shared_ptr

    Out of curiosity, supposing this is the deleter:

    class DebugDelete {
    public:
    DebugDelete(ostream& s = cerr): os(s) { }
    template<typename T> void operator()(T* ptr) const...
  23. Replies
    1
    Views
    654

    Software for C++ template profiling

    Does anybody know whether there are software for template debugging/profiling like this one Templight for Debian 8.x GNU Linux? Which program should I have to use?
    Thanks in advance
  24. Replies
    18
    Views
    3,403

    I've checked on the book, for the owners look...

    I've checked on the book, for the owners look §14.1 at "Choosing member or non-member implementation"
    It explain that for symmetric operator like arithmetic it's usual deal with mixed type for...
  25. Replies
    18
    Views
    3,403

    Cpp Primer 5th Edition this one:...

    Cpp Primer 5th Edition this one: https://play.google.com/store/books/details/Stanley_Lippman_C_Primer?id=J1HMLyxqJfgC
Results 1 to 25 of 38
Page 1 of 2 1 2