Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Igor Yankovsky
    @iyankovsky
    Hello! Do you guys have any experience with using C++14 for mobile development?
    Jason Turner
    @lefticus
    I do not - It's been a while since I got to do any mobile development at all
    Stuart Bowman
    @sbowman-mitre
    Not, none at all.
    Bart
    @louwers
    Anyone here?
    I wonder how hard it is to hack together a concurrent web server with C++.
    Jason Turner
    @lefticus
    Bart
    @louwers
    Thanks @lefticus. I've come to the conclusion that C++ might not be the best language for a simple HTTP REST API ;-)
    Sunil Choudhury
    @linuschoudhury
    is this group active
    Jason Turner
    @lefticus
    It can be!
    Jason Turner
    @lefticus
    @linuschoudhury I'm here for discussion, but no one else has really ever joined in.
    Sunil Choudhury
    @linuschoudhury
    i too think so
    is there any c++ groups in gitter
    Jason Turner
    @lefticus
    Not that I know of, if you do find another, let me know.
    Grant Rostig
    @grantrostig
    @iyankovsky I'm getting into http://qt.io . Seems to be very good.
    is there any c++ groups in gitter
    @linuschoudhury gitter does to support keywords. I have a group that focuses on learning C++ called http://gitter.im/CppMSG. No content on gitter yet, but we are trying to create some. Our center of operations is http://meetup.com/cppmsg .
    Grant Rostig
    @grantrostig
    @lefticus , I like your project and your videocast. :)
    dongshimou
    @dongshimou
    有中文么?
    my english is poor
    Grant Rostig
    @grantrostig
    My code was recently criticized for using a while loop instead of a for loop. I was told that incrementing my loop variable (iterator) at the bottom of the loop was more likely to become buggy due to later sloppy code changes. Also told that the c++ optimizer might have more trouble optimizing and "un-rolling" the loop. On the other hand, the only way to use a for loop was to iterate in reverse, since elements of the vector were being deleted. I figured that was pretty ugly, especially with the "-1" required for loop conditional in the for solution. Opinions? So is "while" looked down upon in Modern C++?
    Darrell Wright
    @beached
    @grantrostig what about vect.erase( std::remove_if( vect.begin( ), vect.end( ), predicate ), vect.end( ) );
    Clément Grégoire
    @Lectem
    Just use reverse iterators ?
    While loop have specific purposes, iterating on a known range is more of a 'for' use case even in reverse order imo
    While loop are best used on containers when you dont know the range / number of iterations
    Konstantin Frumkin
    @fro0m
    Hi
    Great idea to set a collection of best practices of using c++.
    Konstantin Frumkin
    @fro0m
    Having moved to c++14 I faced with problem that for best code it is nice to use templates with universal references, but do not understand clearly how to involve coding style with templates and classes' methods the right way. It makes shit code if I put templates methods into class. I have to move implementation of templates in the additional file and some more bad looking code.
    Is there since of using universal references this way. I do not know.
    Sence
    Grant Rostig
    @grantrostig
    @Lectem thanks for the advice.
    Grant Rostig
    @grantrostig
    @beached , nice STL solution. However I was iterating because I needed to do another operation in addition to the vect.erase(). The idea is to find specific elements and move them to a destination vector and them immediately erase these elements from the source vector. Do you know of a STL approach to that scenario? I don't want to first remove the elements and then erase them in another loop (or algorithm).
    Darrell Wright
    @beached
    @grantrostig maybe copy the item in the predicate? if( some true thing ) { othervector.push_back( item ); return true; } return false....
    Haven't tested though
    @grantrostig actually, you cannot do a move there. but you can do a copy. or another option is to use std::partition and then use the returned iterator as the start of the copy to the new vector and then do the erase with it after
    auto new_end = std::partition( vect.begin( ), vect.end( ), predicate );
    std::copy( new_end, vect.end( ), std::back_inserter( some_other_vector ) );
    vect.erase( new_end, vect.end( ) );
    Darrell Wright
    @beached
    @grantrostig if you have c++ 17 then std::remove_copy_if might do it too
    AnasBour
    @AnasBour
    Hi, I have to present c++ best practices to my colleagues who are mostly beginners or intermediate, what references would you recommend?
    Jason Turner
    @lefticus
    you can start at cppbestpractices.com
    Victor Queiroz
    @VictorQueiroz
    Hi
    Do you think std::variant is a good practice?
    Jason Turner
    @lefticus
    It certainly can be. It can be used in low-zero overhead ways
    depends on what you need to do
    Joseph Nicholas R. Alcantara
    @josephnicholas
    Hi @lefticus I don’t know if this channel is stil active, but is there a introduction of using constexpr?
    Mateusz Łoskot
    @mloskot
    Scroll up, compare dates