Improve your C++ with Inspirations from other languages - Andreas Reischuck
A new video from Meeting C++ 2017:
Improve your C++ with Inspirations from other languages
by Andreas Reischuck
September 13-19, Aurora, CO, USA
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
By Meeting C++ | Jan 19, 2018 10:21 AM | Tags: python programming meetingcpp intermediate haskell experimental efficiency basics
A new video from Meeting C++ 2017:
Improve your C++ with Inspirations from other languages
by Andreas Reischuck
By Meeting C++ | Jan 10, 2018 03:05 AM | Tags: meetingcpp lightningtalks basics
The 3rd and last part of lightning talks at Meeting C++ 2017
function_ref
by Vittorio Romeo
A variant of recursive decent parsing
by Björn Fahller
A quick view into a compiler
by Arvid Gerstmann
Algorithms and Iterators for Multidimensional Arrays
by Cem Bassoy
A short story about configuration file formats
by Andreas Rein
By Adrien Hamelin | Jan 8, 2018 11:32 AM | Tags: basics
Quick A: Do not confuse mathematical concepts with C++ terminology.
Recently on SO:
Confused about vectors
You are getting confused because the mathematical concept of a vector can mean a "collection of data" and that is what you were taught int v[10] was. The actual name for that in C++ (and most other languages) is an "array" not a vector.
The libraries referred to in C++ Primer have a class called "vector" which is an implementation of an array. They are similar, but not the same.
I hope that clears that up a bit. You are probably confused because you were taught that int v[10] is a vector, but it is "not really" in C++. It's an array. Use that term to refer to it. If you ever refer to it as a vector, you will confuse others and yourself.
By Meeting C++ | Dec 28, 2017 04:54 AM | Tags: meetingcpp embedded basics
The video of the closing keynote from Meeting C++ 2017 is online:
Embedded & C++ - Meeting C++ 2017 Keynote
by Wouter van Ooijen
By Meeting C++ | Dec 23, 2017 06:39 AM | Tags: meetingcpp keynote intermediate efficiency community basics
The first keynote from Meeting C++ 2017 has been published:
Kate Gregory - It's Complicated - Meeting C++ 2017 Center Keynote
by Kate Gregory
By bfilipek | Dec 6, 2017 10:51 AM | Tags: basics
Examples where unique_ptr shines:
5 ways how unique_ptr enhances resource safety in your code
by Bartlomiej Filipek
From the article:
While shared_ptr and weak_ptr are more complex, unique_ptr seems to be a perfect replacement for owning raw pointers. Not to mention is the fact that this pointer type is mostly a compile time “wrapper” and it cost almost nothing in the runtime.
By Adrien Hamelin | Nov 9, 2017 02:46 PM | Tags: basics
Quick A: It tell the compiler not to do any implicit conversions of types.
Recnetly on SO:
What does the explicit keyword mean?
The compiler is allowed to make one implicit conversion to resolve the parameters to a function. What this means is that the compiler can use constructors callable with a single parameter to convert from one type to another in order to get the right type for a parameter.
Here's an example class with a constructor that can be used for implicit conversions:
class Foo { public: // single parameter constructor, can be used as an implicit conversion Foo (int foo) : m_foo (foo) { } int GetFoo () { return m_foo; } private: int m_foo; };Here's a simple function that takes a Foo object:
void DoBar (Foo foo) { int i = foo.GetFoo (); }and here's where the DoBar function is called.
int main () { DoBar (42); }The argument is not a Foo object, but an int. However, there exists a constructor for Foo that takes an int so this constructor can be used to convert the parameter to the correct type.
The compiler is allowed to do this once for each parameter.
Prefixing the explicit keyword to the constructor prevents the compiler from using that constructor for implicit conversions. Adding it to the above class will create a compiler error at the function call DoBar (42). It is now necessary to call for conversion explicitly with DoBar (Foo (42))
The reason you might want to do this is to avoid accidental construction that can hide bugs. Contrived example:
- You have a MyString(int size) class with a constructor that constructs a string of the given size. You have a function print(const MyString&), and you call print(3) (when you actually intended to call print("3")). You expect it to print "3", but it prints an empty string of length 3 instead.
By bfilipek | Oct 31, 2017 12:49 AM | Tags: basics
Let’s investigate what "not_null" (from the Core Guidelines/Guideline Support Library) can do for us.
How not_null can improve your code?
by Bartlomiej Filipek
From the article:
I believe "not_null" can help in many places. It won’t do the magic on its own, but at least it forces us to rethink the design. Functions might become smaller (as they won’t have to check for nulls), but on the other hand, the caller might require being updated.
By Meeting C++ | Oct 18, 2017 01:41 AM | Tags: meetingcpp intermediate conference community basics advanced
With the conference just a few weeks away, an update on the 3 awesome keynotes of this years Meeting C++:
Keynotes at Meeting C++ 2017
by Jens Weller
From the article:
Are you excited for Meeting C++ 2017?!? I quickly wanted to give an update on the 3 keynotes at the conference this year! Each day will feature one keynote, where the first two are in the morning, while the Closing Keynote is kind of the last thing to happen before the closing message. Also, all 3 keynote speakers have now (finally) their speaker profile.
By Meeting C++ | Oct 13, 2017 04:04 AM | Tags: qtdev qt python meetingcpp c++14 basics
New Just C++ episode, this time its about porting some python code to C++:
Just C++ - Penrose tiling from python to C++ & Qt
by Jens Weller