21
Val Kilmer, Star of ‘Batman Forever,’ ‘Tombstone,’ 'Real Genius' Dies at 65     (variety.com)
submitted by iSnark to RIP 6 hours ago (+21/-0)
14 comments last comment...
9
What's the difference between batman and a black man     (files.catbox.moe)
submitted by kammmmak to funny 2 hours ago (+9/-0)
0 comments...
27
Spain Now Has Groups Dedicated To Evicting Illegal Occupants     (files.catbox.moe)
submitted by Kozel to Diversity 9 hours ago (+28/-1)
8 comments last comment...
Property owners can now contact such groups to quickly and effectively evict illegal occupants from their properties.
55
Can't be unseen. LOL     (files.catbox.moe)
submitted by ProudRebel to funny 13 hours ago (+55/-0)
8 comments last comment...
16
Tesla Destroyer      (pomf.lain.la)
submitted by boekanier to whatever 6 hours ago (+16/-0)
2 comments last comment...
7
Canadian election rocked by Indian interference allegations – India-born MP expelled     (archive.md)
submitted by dulcima to WorldNews 2 hours ago (+7/-0)
1 comments last comment...
18
In Nazi Germany, there wasn't a property tax on the Germans' homes.     (TellUpgoat)
submitted by Sleazy to TellUpgoat 7 hours ago (+18/-0)
4 comments last comment...
5
Bolts that came with my new wheelbarrow are based as fuck original content     (files.catbox.moe)
submitted by Volf to whatever 1 hour ago (+5/-0)
2 comments last comment...
24
Leave a thumb's up     (files.catbox.moe)
submitted by kammmmak to whatever 11 hours ago (+24/-0)
18 comments last comment...
30
Welcome Home     (files.catbox.moe)
submitted by Kozel to VIBE 13 hours ago (+30/-0)
11 comments last comment...
46
Elon: the U.S. Institute of Peace deleted 1TB of financial data linking them to funding Taliban & Iraqi leadership—but DOGE wasn’t fooled. They attempted to scrub the records, but DOGE engineers recovered the entire archive.     (pomf2.lain.la)
submitted by bossman131 to whatever 16 hours ago (+47/-1)
20 comments last comment...
15
Woke Gay Agenda     (files.catbox.moe)
submitted by Trope to ShitpostLitterBox 10 hours ago (+15/-0)
8 comments last comment...
11
Italian government slams judiciary after latest court ruling demands compensation for illegal [negroid] migrants      (whatever)
submitted by Flanders to whatever 8 hours ago (+11/-0)
1 comments last comment...
America is not the only country with Leftist, Globalist-led and jewish-minded judges who cater to imported dregs, and slap the faces of the countrymen in whose land they reside.

"The Italian government has been ordered to compensate migrants from the 2018 Diciotti ship standoff, a ruling that has sparked political backlash ....

As a result of this decision, the government will have to compensate — with the money of honest Italian citizens who pay taxes — people who have attempted to enter Italy illegally, that is, by violating the law of the Italian state,” Meloni said in a post on X." [MORE]:

https://rmx.news/article/italian-government-slams-judiciary-after-latest-court-ruling-demands-compensation-for-illegal-migrants/
13
C++: When efficient operations and the language itself are one and the same     (pomf2.lain.la)
submitted by SithEmpire to C 9 hours ago (+13/-0)
8 comments last comment...
https://pomf2.lain.la/f/819ag2cg.png

The linked image has formatting as intended originally; for the post text I had to use alternative characters to avoid triggering the site formatting, which REALLY needs a proper pre-formatted code feature.

Where most other languages have rules about passing primitive types by value and objects by reference, C/C++ builds subtle control of that into its language. This is no simple quirk; passing by value is also known as copying, and that comes with a real performance cost, such that learning a language which controls it is the nature of achieving good performance in and of itself.

Consider a simple and fairly useless class representing a square with a width and a height, entirely public to ignore encapsulation for now. We store the width and height, and we provide an area calculation and a function to scale its size:

class Square
{
public:
double width;
double height;

double area()
{
return width ✱ height;
}

void scale(double factor)
{
width ✱= factor;
height ✱= factor;
}

};

This works at least, but neither as optimally nor with as much freedom as it could have.

The freedom point is good to address first; consider how that area function. Despite only reading the class variables without changing them, the entire function will be treated as if it can conceivably change the Square object on which it is called. Due to that, the area function will be inaccessible given a const Square object, even though it makes no changes.

The area function should be specified like this:

double area() const
{
return width ✱ height;
}

Shoving const in the function header makes the object fields read-only within the function—in return for being allowed to call the function on a const version of the object. Use of const is both a means of object protection and also a precursor to compiler optimisations such as avoiding copying and reloads.

Now to be more optimal, consider the scale function. It modifies the object and thus cannot be const, but this is about the scale factor parameter. Calling that function will supply it with a copy of the factor, which can be appropriate if it genuinely needs a temporary copy it can modify without affecting the calling code, but clearly it doesn't change the factor. In one sense, it would be better to accept a reference instead:

void scale(double & factor)
{
width ✱= factor;
height ✱= factor;
}

This bypasses the overhead of copying, although now that function cannot be used with a const double, because it could conceivably change the value (even though in practice it doesn't). This applies to calls with literal number as the factor, such as scale(1.5)—that 1.5 is itself a const double.

The scale function should be specified like this:

void scale(const double & factor)
{
width ✱= factor;
height ✱= factor;
}

Introducing that guarantee now allows literal numbers and any named values (const or otherwise), while also avoiding copying anything.

Even though this example involves only a double weighing in at 8 bytes, that is nonetheless both how to talk to the C/C++ compiler and also how to avoid unnecessary copying. It is not an early optimisation mistake; it is a basic part of the language which should be in continual use, it just so happens that the language and the optimisation are one and the same!
18
Grandpa, why did all your friends die in car accidents?     (files.catbox.moe)
submitted by crackhead to whatever 11 hours ago (+18/-0)
15 comments last comment...
7
how it works     (pomf.lain.la)
submitted by boekanier to whatever 6 hours ago (+7/-0)
4 comments last comment...
27
The CLASSIC wahmen moment     (files.catbox.moe)
submitted by big_fat_dangus to cringe 14 hours ago (+27/-0)
19 comments last comment...
9
Ukraine has secret nuclear doomsday plan, according to former Zelensky adviser     (whatever)
submitted by Flanders to whatever 8 hours ago (+9/-0)
3 comments last comment...

"Ukraine's leadership would rather destroy the entire country and the Russians with it than accept defeat, he claims

Ukraine has a secret last-ditch “scorched earth” plan to render its entire territory uninhabitable in the event of a Russian victory in the war – and perhaps the rest of Europe with it."
-----------
Moreover, the Chernobyl disaster required the combined resources of the Soviet Union, as well as the assistance it received from other countries, to contain it. In a scenario where several nuclear plants were destroyed simultaneously, it would likely exceed the ability of any nation to bring it under control. The resulting casualties and damage to the environment would therefore be many times worse than what happened in 1986.

Nor would this catastrophe be limited to Ukraine and Russia: Harmful radioactivity would undoubtedly be carried by the atmosphere and spread over the rest of Europe as well. [MORE]:

https://rmx.news/article/ukraine-has-secret-nuclear-doomsday-plan-according-to-former-zelensky-adviser/
39
Easy, it was called paying attention      (files.catbox.moe)
submitted by kammmmak to whatever 17 hours ago (+39/-0)
37 comments last comment...
1
JFK's quote 7 days before his death     (files.catbox.moe)
submitted by Conspirologist to Quotes 4 hours ago (+3/-2)
0 comments...
17
🧹👃🌒 [Cackles]     (files.catbox.moe)
submitted by UncleDoug to Jewdar 13 hours ago (+17/-0)
2 comments last comment...
7
Jewish Slave Owners     (whatever)
submitted by NuckFiggers to whatever 8 hours ago (+7/-0)
5 comments last comment...
Where are the stats that show the number of kikes that owned slaves?

2
Susan Crawford wins Wisconsin Supreme Court race, defying Elon Musk     (www.nbcnews.com)
submitted by Sal_180 to UpliftingNews 3 hours ago (+2/-0)
8 comments last comment...
2
Why Disney wants to erase this beloved cartoonist from history     (www.youtube.com)
submitted by the_old_ones to Comics 3 hours ago (+2/-0)
1 comments last comment...
1
A million corpses: How many lives does the game in Ukraine cost?      (english.pravda.ru)
submitted by boekanier to Ukraine 54 minutes ago (+1/-0)
0 comments...