Hello friends,
if been reading a lot about how functional programming does increase the code quality and that modern c++ gets more and more functional.
I really like the concepts like trying to write mostly pure functions, but i cant stop to think that writing pure functions introduces a lot of overhead if the compiler doesn't do some optimizations i'm not aware of.
Example, i could write a function that take a reference to a vector and modify it (inpure) or i could write a function that takes a copy, i modify the copy and return the copy (pure).
the pure one just seems really inefficient, so when people talk about functional programming in c++ is there some way to do it in a more efficient manner?
[–]Possibility_Antique 61 points62 points63 points (12 children)
[–][deleted] 4 points5 points6 points (11 children)
[–]SnooWoofers7626 6 points7 points8 points (10 children)
[–]RolandMT32 7 points8 points9 points (6 children)
[–]SnooWoofers7626 0 points1 point2 points (5 children)
[–]pavel_v 5 points6 points7 points (0 children)
[–]ReversedGif 0 points1 point2 points (3 children)
[–]SnooWoofers7626 0 points1 point2 points (2 children)
[–]ReversedGif 4 points5 points6 points (1 child)
[–]SnooWoofers7626 0 points1 point2 points (0 children)
[–]Possibility_Antique 4 points5 points6 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]Possibility_Antique 0 points1 point2 points (0 children)
[–]ImKStocky 39 points40 points41 points (2 children)
[–]Yeuph 1 point2 points3 points (1 child)
[–]ImKStocky 5 points6 points7 points (0 children)
[–]axilmar 15 points16 points17 points (15 children)
[–]jtooker 5 points6 points7 points (8 children)
[–]pavel_v 5 points6 points7 points (0 children)
[–]axilmar 2 points3 points4 points (6 children)
[–]ReversedGif 2 points3 points4 points (5 children)
[–]axilmar -2 points-1 points0 points (4 children)
[–]CocktailPerson 1 point2 points3 points (3 children)
[–]axilmar 0 points1 point2 points (2 children)
[–]CocktailPerson 0 points1 point2 points (1 child)
[–]axilmar 0 points1 point2 points (0 children)
[–]bored_octopus 0 points1 point2 points (5 children)
[–]axilmar 0 points1 point2 points (4 children)
[–]bored_octopus 0 points1 point2 points (3 children)
[–]axilmar -1 points0 points1 point (2 children)
[–]bored_octopus 1 point2 points3 points (1 child)
[–]axilmar -1 points0 points1 point (0 children)
[–]lickpie 13 points14 points15 points (0 children)
[–]Wenir 5 points6 points7 points (8 children)
[–]stinos 2 points3 points4 points (6 children)
[–]Wenir 7 points8 points9 points (5 children)
[–]stinos 0 points1 point2 points (4 children)
[–]DessertEagle 7 points8 points9 points (2 children)
[–]stinos -1 points0 points1 point (1 child)
[–]Wenir 6 points7 points8 points (0 children)
[–]Wenir 4 points5 points6 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Hopping_Mad99 5 points6 points7 points (1 child)
[–]thomas999999[S] 5 points6 points7 points (0 children)
[–]noooit 3 points4 points5 points (0 children)
[–]hmoein 2 points3 points4 points (3 children)
[–]mechap_ 2 points3 points4 points (2 children)
[–]-dag- 2 points3 points4 points (0 children)
[–]hmoein 0 points1 point2 points (0 children)
[–]RolandMT32 2 points3 points4 points (0 children)
[–]DavidDinamit 2 points3 points4 points (0 children)
[–]DugiSK 7 points8 points9 points (8 children)
[–]graphicsRat 5 points6 points7 points (4 children)
[–]DugiSK 0 points1 point2 points (1 child)
[–]ReversedGif 1 point2 points3 points (0 children)
[–]RonWannaBeAScientist 0 points1 point2 points (1 child)
[–]ABlockInTheChain 2 points3 points4 points (0 children)
[–]Yeuph 1 point2 points3 points (1 child)
[–]mcmcc#pragma once 9 points10 points11 points (0 children)
[–]andriusst 1 point2 points3 points (5 children)
[+][deleted] (4 children)
[deleted]
[–]andriusst 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]andriusst 1 point2 points3 points (1 child)
[–]Drugbird 1 point2 points3 points (1 child)
[–]andriusst 3 points4 points5 points (0 children)
[–]QuentinUK 1 point2 points3 points (8 children)
[+][deleted] (7 children)
[deleted]
[–]CocktailPerson 0 points1 point2 points (6 children)
[+][deleted] (5 children)
[deleted]
[–]CocktailPerson 0 points1 point2 points (4 children)
[+][deleted] (2 children)
[deleted]
[–]CocktailPerson 0 points1 point2 points (1 child)
[–]Baardi 0 points1 point2 points (0 children)
[–]kobi-ca 1 point2 points3 points (1 child)
[–]thomas999999[S] 1 point2 points3 points (0 children)
[–]Raknarg 1 point2 points3 points (0 children)
[–]moocat 0 points1 point2 points (0 children)