-
mj-xmr[m]
<selsta> "mj-xmr: ok solved it, will PR..." <- That was fast :)
-
Guest7777
hello
-
Guest7777
from 4/7 hardfork wownero price is X3
-
Guest7777
why monero dont insert the same
-
Guest7777
300%
-
Guest7777
why monero dont obligate solo mining
-
sethsimmons
Guest7777: Not for this room, please take it to #monero or #monero-mining
-
sech1
-
sethsimmons
sech1: I learn new things from you every day, sech1 😅
-
Guest7777
ok maybe i dont have your deep view
-
Guest7777
but there is some reason right?
-
sech1
it's not a channel to discuss it, ask in #monero
-
Guest7777
monero need reg
-
Guest7777
im not a reg user
-
sethsimmons
Guest7777: Take it to #monero, last warning. This room is strictly for dev discussions.
-
rbrunner
I see a lot of use of std::pair in the Monero codebase, even things like this to pack 3 things: std::pair<std::pair<double, std::time_t>, crypto::hash>
-
rbrunner
(That one is from the tx pool code)
-
rbrunner
And then beauties like this code line: else if (a.first.second < b.first.second) return true;
-
rbrunner
If I think that really cries for a 3-element struct, am I just inexperienced in C++, or would I have a point?
-
merope
Technically there are tuples as well in the standard library, but the syntax is more annoying
-
rbrunner
Do I overlook some really wonderful advantages of pairs, tuples, whatever over a lowly, simple, and *expressive* struct (because of member names)?
-
rbrunner
I mean, why should I endure "a.first.second" instead of "a.time"?
-
rbrunner
(The Monero angle is, by the way, that I want to write code that does similar things for the tx_pool, and wonder whether to break with that "pair style" or blend in by using it)
-
UkoeHB
Presumably you don't have to write the few extra lines for a new struct... (just rely on the std::pair<> template)
-
rbrunner
Yeah, I see, but how many times already I started out with a struct with two members, covered by a pair, which grew to 5 members over time ... (with other programming languages)
-
UkoeHB
🤷♂️
-
hyc
^
-
merope
The point of tuples is to have a "one-off" structure
-
merope
If you intend to reuse the same structure, then yeah, a struct or a class make more sense
-
merope
(Not the individual variable, but the actual structure)
-
rbrunner
Alright. So if *not* using a pair I won't run into difficulties with the STL that in some places may insist on a pair, or out of luck?
-
rbrunner
Probably not, because deep down a pair must be a struct as well, right?
-
rbrunner
Sprinkled with some templating magic dust :)
-
UkoeHB
The value type of a `std::map` is `std::pair`, so maybe there is something funky related to that...
-
rbrunner
Yeah, but there it makes sense to me, with key and stored element, and I don't have trouble to immediately recognize ".first" and ".second"
-
UkoeHB
I meant maybe there is a std::map or std::unordered_map using your std::pair somehow...
-
rbrunner
Ah, you mean in the code I looked at? It goes into a std::set
-
UkoeHB
hmm yeah struct should work fine then
-
rbrunner
Ok, thanks, I think I can place things better now
-
fluffypony
dartian[m]: good q - that's possibly more a question for #monero-site
-
fluffypony
I don't think using a url shortener for tracking is an issue, there's very little data that most of them can infer, and anyone who is clicking on a marketing link or something is probably not needing mammoth amounts of good opsec lol
-
mj-xmr[m]
<rbrunner> "If I think that really cries for..." <- Ideally a std::tuple, available from C++11. This can be compared against other tuple of the same type (this also sorted), without any butchery, like you have to do with pairs.
-
mj-xmr[m]
But you could also write a special struct for this, if you have time.
-
mj-xmr[m]
The struct will however not be automatically comparable, like the tuple is.
-
mj-xmr[m]
mj-xmr[m]: *this means also, that it can be sorted in a list of the same tuples, I meant.