r/cpp11 • • Jun 20 '17

nullptr

Post image
6 Upvotes

r/cpp11 • • Mar 31 '16

Awesome Modern C++ (list of only high quality resources, help me make it even better)

Thumbnail
github.com
5 Upvotes

r/cpp11 • • Mar 18 '15

The Power of C++11 in CUDA 7

Thumbnail
devblogs.nvidia.com
5 Upvotes

r/cpp11 • • Jun 27 '17

You don't need a stateful deleter in your unique_ptr (usually)

Thumbnail
dev.krzaq.cc
4 Upvotes

r/cpp11 • • Mar 16 '15

Semaphores are Surprisingly Versatile

Thumbnail
preshing.com
4 Upvotes

r/cpp11 • • Oct 07 '14

The C++ Ten Commandments | Marius Bancila's Blog

Thumbnail
mariusbancila.ro
4 Upvotes

r/cpp11 • • Jul 23 '14

Delegating Constructors in C++11

Thumbnail 741mhz.com
4 Upvotes

r/cpp11 • • Apr 14 '14

Converting between numbers and strings in C++11

Thumbnail codexpert.ro
4 Upvotes

r/cpp11 • • Feb 16 '14

Exploiting the delete specifier. [X-post: /r/cpp]

Thumbnail
cpp-today.blogspot.it
4 Upvotes

r/cpp11 • • Apr 02 '13

Ten C++11 Features Every C++ Developer Should Use [x-post: /r/cpp, credit to /u/meetingcpp]

Thumbnail
codeproject.com
4 Upvotes

r/cpp11 • • Feb 03 '13

What's the point of std::type_info::hash_code()?

4 Upvotes

Perhaps the standard committee wanted a means of creating a method that would be useful when using type identifier as keys in containers such as map. The problem I have with hash_code() is that:

1.) It requires RTTI to be enabled, which seems like a waste if there is no other reason to enable RTTI, since run-type info will be generated for everything.

2.) It is not guaranteed to be unique, so type_info has to be checked to prevent collisions. Although implementations are free to make hash_codes unique, it is not guaranteed.

3.) It is not guaranteed to be compatible across compilers.

4.) Implementing a solution to fix all of the issues above seems trivial.

The following code will generate a unique id per type, which is cross-compiler compatible and doesn't require RTTI:


//  TypeIdentifier.h
long assignInternal();

template<typename T>
class TypeIdentifier{
public:
    static long getTypeId();
private:
static long _typeId;
};

template<typename T>
long TypeIdentifier<T>::_typeId = assignInternal();

template<typename T>
long TypeIdentifier<T>::getTypeId(){
    return _typeId;
}

//  TypeIdentifier.cpp
#include "TypeIdentifier.h"
#include <atomic>

namespace{
    std::atomic_long typeIdCounter = ATOMIC_VAR_INIT(0L);
}

long assignInternal(){
    return std::atomic_fetch_add(&typeIdCounter, 1L);
}

The code above can be used like this: TypeIdentifier<MyType>::getTypeId()

I read (somewhere) that the committee defined hash_code() to eliminate the endless variations on the theme above, but to me, it seems like the shortcomings of the standard implementation are too great.. Thoughts?

[edit: grammar]


r/cpp11 • • Jan 27 '24

🚀Framework 🧠 Write Asynchronous Code With C++11 | Nodepp

3 Upvotes

Hi there, I would like to show you a framework called Nodepp. This is a project I've been working on for a while, making this idea into reality.

In summary, this framework will let us create C++ code asynchronously, with a syntax similar to NodeJS or Javascript.

I have to point out that this framework is compatible with C++11 | C++14 | C++17

If you're interested, let me know what do you think about it 👍.

with Nodepp, you can create:

  • TCP | TLS | UDP Servers & Clients

  • HTTP | HTTPS Servers & Clients

  • WS | WSS Servers & Clients

  • Poll | Epoll | Kqueue Support

  • File Streams

  • zlib streams

  • Generators

  • Coroutines

  • Observers

  • Promises

  • Timers

  • Events

And so on. Here is a simple example of a WebSocket server created with Nodepp:

Here's another example of an HTTP Server created with Nodepp

If you’re interested in Nodepp, Here is the Github repository:


r/cpp11 • • Aug 03 '19

fixing c++ with epochs

Thumbnail
vittorioromeo.info
3 Upvotes

r/cpp11 • • Mar 24 '19

Nameof operator for modern C++, simple name of a variable, type, member, function, macros, and enum.

Thumbnail
github.com
3 Upvotes

r/cpp11 • • Aug 28 '17

Property Binding Library C++

3 Upvotes

Hello I'm a student writing my masters degree and i got a thesis about researching and writing a property binding library for C++.

My question to you guys is:

  • What extra functionality would you like to have in such a library?

  • Do you have some tips for me and sources i should have a look into?

  • Special standards you think i should use? (at the moment it's only -std=c++11 and newer)


r/cpp11 • • Aug 04 '17

Star pattern 17 in Dev c and c++//cp and cpp program of star pttern

Thumbnail
youtube.com
3 Upvotes

r/cpp11 • • Mar 16 '15

Dive into C++11

Thumbnail
youtube.com
3 Upvotes

r/cpp11 • • Mar 15 '15

Templates as first-class citizens in C++11

Thumbnail
vitiy.info
3 Upvotes

r/cpp11 • • Mar 12 '15

C++11 FAQ

Thumbnail stroustrup.com
3 Upvotes

r/cpp11 • • Nov 16 '14

C++11: non-member begin() and end()

Thumbnail
codexpert.ro
3 Upvotes

r/cpp11 • • Jul 23 '14

Inheriting Constructors in C++11

Thumbnail 741mhz.com
3 Upvotes

r/cpp11 • • Jul 14 '14

Initialization Subtleties in C++11

Thumbnail aristeia.com
3 Upvotes

r/cpp11 • • Jul 06 '14

C++11 Final Override

Thumbnail 741mhz.com
3 Upvotes

r/cpp11 • • Jun 16 '14

Better types in C++11

Thumbnail
cprogramming.com
3 Upvotes