jump to:all–mastodon–bluesky–lemmy–lobsters–dev–stack–wiki–rss–hn
wwebbit
view: | | |

Knowledge / everything · hot matching “c++”

2 shown · updated 7s ago · read only
  1. What is the difference between `std::launder(ptr)` and `reinterpret_cast (reinterpret_cast (ptr))` in C++29? (stackoverflow.com)stack

    23 points by cpplearner in stackoverflow.com · 16h ago · stack comments

    In N5054, reinterpret_cast from integer to pointer is specified as ( [expr.reinterpret.cast] ): A value of integral type or enumeration type can be explicitly converted to a pointer. If the value is one that can be produced by converting one or more pointer values to an integral…
    filed under c++pointersc++29
  2. Bresenham's Midpoint Algorithm, How do I fill in the gaps? (stackoverflow.com)stack

    3 points by user2779315 in stackoverflow.com · 13y ago · stack comments

    I am attempting to draw a circle (and eventually fill the entire circle) using Bresenham's Midpoint Algorithm . It will become the outline for fog of war in a basic 2D game. Instead of drawing a line or filling a pixel I am changing values in a 2D vector. This works correctly an…