« first day (537 days earlier)      last day (4423 days later) » 

12:03 PM
if I have an enum myEnum is there a neat way to do something like myEnum.valueA
I don't think there is
 
myEnum::valueA.
 
gonna go home soon
 
kthxbye
 
With old enums enumerators are put both in surrounding scope and in the new one. enum class doesn't contaminate the surrounding one.
 
@CatPlusPlus I thought so...
but that is using enum class myEnum isn't it, and then I loose the ability to implicitly use the int value
 
12:08 PM
TIL
A Turing tarpit is any programming language or computer interface that allows for flexibility in function but is difficult to learn and use because it offers little or no support for common tasks. The phrase was coined by Alan Perlis in the epigram In any Turing complete language, it is possible to write any computer program, so in a very rigorous sense nearly all programming languages are equally capable. Turing tarpits show that theoretical ability is not the same as usefulness in practice. Turing tarpits are characterized by having a simple abstract machine which requires the user ...
 
AKA esoteric programming languages
 
and believe it or not, I spelt esoteric correctly first time with out any effort :D
I failed to spell programming first time though :(
 
I rub my face in sleepiness
 
12:21 PM
I have to admit: TortoiseHg sucks at big repositories, like Chromium source code (~1Gb) =(
 
Doesn't Chromium use SVN?
Or git, possibly.
 
@CatPlusPlus yep, they does, but I wanted to use Hg
 
@Abyx hang on... if Chromium use SVN, don't you have to either fork it or suck it up and use SVN?
 
You can pull from SVN repo into a hg/git repo with no problem.
 
@thecoshman I checked it out from svn, and created hg repository on top of if. It works fine with not-so-big projects, but in case of Chromium it's incredibly slow.
 
12:32 PM
oh yeah, forgot about that
is that ~1GB for the entire repo, or just for the latest version?
 
Hg should work fine with 1GB repo. TortoiseHg might be overloading itself.
 
Ell
hi :)
"In any Turing complete language, it is possible to write any computer program" - I don't understand this - if a language cannot output to the screen, it is not turing complete because another language that can output to the screen has written a program it can't
if that made any sense? Can someone settle my confusion? o.O
 
@thecoshman it's size of source code
 
@Abyx The chromium source code is what? 1Gb doesn't really make sense
At all:
 
@CatPlusPlus commands like hg status works not so fast too
 
12:38 PM
> As of linux-2.6.21 the size is 308MB for the full repository. Users of git 1.5.0 and newer can use a git feature named shallow tree to prune the history. This can reduce the repository to as little as 112MB. An additional 297MB are needed for checking out the repository plus another upto 90MB for building - even more for very large configurations, debugging etc.
Using aggressive compression settings (see git-pack-objects manpage) on the order of 70MB can be saved for the full repository at the price of somewhat lower performance.
 
@Abyx erm... so just the latest version of the source code? or all of the revision info for it as well?
 
Chromium tree contains Webkit.
 
@thecoshman See ^^ I better hope all history
 
@sehe yeah, 1GB is a hell of a lot of source code
 
@CatPlusPlus Same difference. I don't really see how that justifies 1Gb (unless it contains a heap of regression tests with rendered images included, in which case it simply isn't about source code anymore)
 
12:40 PM
For a large self-contained project 1GB is nothing.
 
it contains everything =(
form WebKit to YASM
 
well if your going to be stupid and every dependency to your source control then what do you expect
 
It's not stupid.
 
@CatPlusPlus Good samples? I mean, I think it is well established that the Linux Kernel is both large, and self-contained. What's more, it carries several decennia of history
 
Easily replicable build environment is a huge time and effort saver.
Especially on Windows.
 
12:42 PM
@thecoshman not stupid, because you can just checkout it, build and run
 
@CatPlusPlus But it doesn't need to be in your project repo. I mean, you don't store virtual machine images in the same Hg repo as your source for convenience
 
if you write a project that is built on top of a library. All you need in your repository is to have part of the build system check out from the dependencies source control
 
That's unreliable.
 
@thecoshman Depends on the definition of built on top
 
I'll admit that if you can't trust your dependencies to stick around you might want to include them as part of your project, but then, do you really want to rely on flaky projects?
 
12:43 PM
It's not about projects disappearing.
 
@thecoshman in Windows, there is no such build system
 
@Abyx there are loads of cross platform build systems that can let you run things such as that
 
Any sane build system is capable of that.
 
ok, you can say "in Windows, there is no sane build system"
but it doesn't change anything
 
Not really true.
(Well, all of them mostly suck, but still. Not dependent on the platform.)
 
12:46 PM
you have solution file and MSVS or msbuild
 
Or make or waf or SCons or...
 
it won't download and install dependencies
 
@Abyx last I checked, visual studio was not the only way to build a project
 
MSBuild is hardly the only build system available on Windows.
(Now I like this sentence!)
In fact, the only pure POSIX ones I can think of right now are autotools (which is as far from being sane as you can possibly get) and that one based on BSD make.
Don't remember the name.
 
ok, but how can you develop'em with other build system? you can't just press "start debug session" button in MSVS, right?
 
12:49 PM
You... can.
Not that everyone uses MSVS.
 
perhaps I missed something, but building a project is only a prerequisite to debugging it, apart from that, they have very little to do with each other
 
Ell
I don't use vcs on windows XD
 
@Ell That's using a narrower definition of computer program, something that transforms an input bitstring into an output bitstring. I/O devices are outside computability theory, and they really do just produce/consume bitstrings anyway. Think data coming over a serial port.
 
Ell
@Potatoswatter okay so as long as we ignore io it works?
 
@Ell Yeah. So we'll talk about C++ templates being Turing-complete, but they have no I/O.
 
Ell
12:58 PM
makes sense now
 
… or more precisely no additional input is accepted after the first output is produced.
 
god damn enums >_<
 
Ell
whats up with enums? :L
 
@thecoshman enum damned { /* enumerators all went to hell */ };
 
I have two enums, each provides codes for named values. Problem is, they both need the same name. I want to be able to do something like enumOne.value and enumTwo.value
but there does not seem be a way to say what enum you want to use to get the value of value
 
1:11 PM
@thecoshman Have you heard of C++11 scoped enumerators?
 
with out breaking implicit conversion to and from integer values
 
@thecoshman Then you can use my semi-scoped enumerator trick.
 
go on...
 
looking it up…
 
Weakly typed enums are scoped, too.
With enum foo { a, b, c }; both foo::a and a are available.
 
1:13 PM
Yeah, that's the gist of it. The scoped syntax works with "unscoped" enums.
 
but if I have the following, enum first{value = 10}; enum second{value = 100}; it will not work, and how can I define which version of value I want.
ideone.com/HOnAB <-- explain what I am doing wrong here then
 
@thecoshman I'm not sure, but I think that will cause a name collision. So you need to wrap the enumerations inside structs.
 
You can't. It's either strict scoping or implicit conversions.
Well, or external namespacingl
@thecoshman Not using C++11 mode.
 
why does std::find not work on a std::wstring ?
 
@CatPlusPlus (╯°□°)╯︵ ┻━┻
 
1:15 PM
it gives me stuff about operator== not matching
 
1
A: A way to use all the unqualified names in a C++0x enum class?

PotatoswatterThis is also something I happen to want, but haven't gotten around to trying to solve. Here's an untested solution. EDIT: I tried it out and it works great! This is my very first C++11 utility macro. Also I added a one-past-the-end enumerator to help extend it to "derived" enumerations. #define ...

 
@TonyTheLion Code.
 
I swear, every other time I use ideon, it select C++11 for me !_!
 
std::wstring to_find = L"blah";
std::wstring::const_iterator found = std::find(path.begin(), path.end(), to_find);
if (found != path.end()) { /*do something */ }
bool std::operator ==(const std::istream_iterator<_Ty,_Elem,_Traits,_Diff> &,const std::istream_iterator<_Ty,_Elem,_Traits,_Diff> &)' : could not deduce template argument for 'const std::istream_iterator<_Ty,_Elem,_Traits,_Diff> &' from 'const wchar_t'
 
1:17 PM
You can't use an std::wstring::const_iterator if you're looking for an std::wstring. std::wstring doesn't hold instances of itself.
What's the type of path?
 
std::wstring
 
Well you can't look for an std::wstring inside an std::wstring.
You can look for a wchar_t.
 
@LucDanton Strings have all those crazy overloads, remember
 
Perhaps you want to use the substr member of std::wstring?
 
meh, but I need to look for a substring
 
1:18 PM
@Potatoswatter That's the std::find algorithm.
 
You have to use std::wstring::find.
 
@LucDanton haha, so it is
 
so std::find can only look for a single wchar_t in the wstring ?
 
when using a std::vector is there any preference between using .at(i) and [i] I guess the former makes it obvious that you are not using an array, but what is wrong with accessing a vector like an array?
 
at() checks bounds, operator[] doesn't.
 
1:22 PM
@TonyTheLion std::find can't tell a string from a vector. The applicable algorithm is std::search.
 
string::find will probably be better than a generic one
 
@CatPlusPlus in other words at() is for wimps?
 
at() is when you don't want to debug silly oob accesses.
 
Damn. I remember seeing a really cool toggle button for WPF but I can't remember where :(
 
1:24 PM
I'm starting a console process with CreateProcess and I need to somehow wait for it to have started before doing something, how can I do this?
 
[] should assert in debug, though.
It started the second you issued CreateProcess.
 
@TonyTheLion However you're communicating with it, it should print a prompt when it's ready to accept input.
 
You can send input before the app is actually waiting on it.
 
@CatPlusPlus In a realtime system, that might be undesirable.
 
1:27 PM
@CatPlusPlus Sometimes you just don't want to wait.
 
What huh? It sounds like he only wants to send input if the output would be immediately available. There are a number of possible reasons for that.
 
problem is, CreateProcess is non-blocking, so I don't know when it's actually fully started, I need to check for an error returned when the process has started running, after creating it
if I put my error check right after CreateProcess it doesn't work, because the process hasn't got to that point yet
 
You can't know when it "fully started", because there's no such thing, unless the app follows a known protocol.
@Potatoswatter He has to wait either way. Waiting for prompt, waiting for output, same difference.
Also lol realtime.
There might be a programmatic check for message pumping, but don't expect anything generic.
@TonyTheLion Error as in exit code?
 
1:32 PM
@CatPlusPlus If you know you're waiting, you can tell upstream components to wait as well. The system is initialized when nobody would need to wait. I don't see how this is remarkable.
 
@CatPlusPlus not necessarily
 
SSCCE and no XYs, plx.
 
@CatPlusPlus what are "XYs" ?
 
http://ideone.com/JhFPp

Is this one the only to emulate callback? thanks!
 
58
Q: What is the XY problem?

GnomeWhat is the XY problem? When asking questions, how do I recognize when I'm falling into it? How do I avoid it? Return to FAQ index

 
1:33 PM
This is a system integration question. SSCCE isn't currency here.
 
Fine, short proof-of-concept example.
 
@CatPlusPlus kthx
 
@CatPlusPlus I always took that to be 'an XY-problem' (the XY-ness isn't the problem, the problem has XY-ness)
 
Whatever. I think I answered it at the first response — send a short prompt message over whatever communication channel this thing is connected to.
 
If you control both apps, then creating and signalling an event is better than fiddling with prompts.
Anyway, off I go.
 
1:39 PM
@user1131997 you don't use void *data; there
 
@user1131997 There's no emulation. That's a C-style callback. In C++ we use std::bind.
 
@Potatoswatter why bind instead of lambdas?
 
@Abyx Depends how you want to refactor it. Some subset of bind, lambdas, and function.
 
can I use post-increment with std::vecotrs? as in int i = numbers[10]++;
 
@thecoshman why not?
 
1:49 PM
@thecoshman euh, yes?
 
@Abyx I thought the way operator[] works might prevent pre/post increment/decrement working
 
That's not a function of std::vector. operator[] just retrieves a reference to a number.
 
that and brain farts
as well as not having done C++ for a long time :P
 
@thecoshman it's int i = numbers.operator[](10).operator++(0);
 
@Potatoswatter ah! thanks! :)
 
1:51 PM
damn you C++ with your operator++(int) =\
 
@Abyx oh man that looks ugly as sin :P
 
Does in C++ exist the analog of extension methods of C# ?
 
@thecoshman looks as C++, and you are right, yep
@user1131997 no
 
@user1131997 No, classes are "closed."
 
@Abyx why is it operator++(0)?
 
1:53 PM
Don't be late for class :vP
@thecoshman postfix
 
@thecoshman because postincrement is operator++(int)
 
@Potatoswatter and to prefix?
what the hell!
 
@thecoshman it's operator++()
 
that is just messed up
I'll just do it a more wordy but less retarded looking way
 
C++ Y U NO PYTHON?!
 
1:54 PM
Also they're allowed to be non-members. So it could also be operator++( numbers.operator[](10), 0 );
Incidentally that's the way it's parsed via overload resolution.
 
@Abyx Is there any way try to emulate extension methods of C++ like in C#?
thanks
 
5 mins ago, by Potatoswatter
Don't be late for class :vP
 
@user1131997 no way
 
@Abyx but they are developed by ms-developers in C++, no?
so there is a way
 
@user1131997 maybe they are in C++/CLI
 
2:02 PM
@user1131997 Not in C++, it could be it's available in c++/cli but that's another language.
 
OMG how did I not already hear about this??
The South Pole Telescope (SPT) is a 10 metre (394 in) diameter telescope located at the Amundsen-Scott South Pole Station, Antarctica. The telescope is designed for observations in the microwave, millimeter-wave, and submillimeter-wave regions of the electromagnetic spectrum, with the particular design goal of measuring the faint, diffuse emission from the Cosmic Microwave Background (CMB). The first major survey with the SPT–designed to find distant, massive, clusters of galaxies through their interaction with the CMB, with the goal of constraining the Dark Energy equation of state...
 
@Abyx why is this not enough? ideone.com/2oODd
 
@user1131997 You can emulate the semantics of extension methods just fine. It's call free functions + ADL (argument dependent lookup).
 
LOL @ Coordinates: 90°00′S 139°16′W
 
Can't emulate the syntax though
 
2:05 PM
@rubenvb enough for what?
 
Yeah, long answer: We don't want extension methods, and went to great lengths to find and use a more flexible solution for functions of several objects.
 
@Potatoswatter no, we want.
 
@Abyx define 'we'
 
Haha, "we" is the group including me, and I think it's the majority of C++ programmers.
 
@sehe me and bunch of other people thinking same way
 
2:07 PM
@Abyx define the bunch ? Of course there are people. Howver, frankly, extension methods in C++ don't look feasible without modules and or concepts, IMO
Also, like @Potatoswatter said, free functions are more generally applicable
 
free functions have ugly syntax
 
@Abyx That point can impossibly be made, because it means functions have ugly syntax
 
With concepts, it would still be a matter of extending the concept. Is that supposed to be allowed? And are concepts supposed to add members?
 
well, maybe D-style uniform function call syntax would be enough
 
It all depends on what you want of course. You probably wanted to say 'extension methods have funky syntax'
@Abyx Better already. But hardly related.
 
2:09 PM
ideone uses C89 mode
ahh
 
@Potatoswatter No, but extension methods need to be declared 'on' something (an interface, a type; You could declare them to a concept if C++ had them)
 
above is C99 ( not near in list... strange :( )
 
@sehe Ideally. But I thought they were just a matter of pretending all nonmembers were really members, as a fallback lookup. Not sure if that was C# or some other language.
 
@user1131997 C99 is beneath C++0x in the list
 
Anyways, in my mind it just makes sense that we don't have extension methods, just like we don't have open classes or reflection, and I don't mind having 'normal' syntax
 
2:11 PM
@user1131997 It's alphabetical by ASCII
 
@Potatoswatter Not far from the point indeed, at least as C# implements them: lookup is extended over visible static member functions declared in visible static classes taking a first parameter with parameter kind 'this' (and where the given instance/value is assignable the type of the first argument)
 
Extension members are like overloading the "." operator. We can overload the -> operator, but see how popular that is. (Tongue in cheek… just a little.)
 
@Abyx for this:
29 mins ago, by thecoshman
can I use post-increment with std::vecotrs? as in int i = numbers[10]++;
 
Actually, operator->* isn't that far away. It only breaks down with polymorphic types, I think
 
Why with my code: ideone.com/BBVNN & stdin ( any value bigger, than 2 ) causes wait and runtime error?
 
2:17 PM
@user1131997 not the debugger, because you clearly didn't use one!
 
@rubenvb didn't use one?
 
@rubenvb that is enough, I just wrote how it's unrolled to operators
 
Basically, I don't want to hide it
 
@user1131997 there is a magical thing, called a debugger, with which you can go through your program's flow step by step. You can even let it stop at some specific point, watch a variable's values at that point, ...
it's a lot more efficient then wasting the time of some random people you encountered on a chat
 
@KillianDS in MSV debugger works well
 
2:22 PM
@user1131997 then go debug it.
 
@Abyx it MSC it works fine, in ideone - no
@Abyx I mean code hasn't errors, in MSV enviroment there were not any runtine error, where in oneide have occured
 
@user1131997 ah... it's because of g++ is crap, as well as *nix
definitely it's not because of your beautiful wall of C-style code
 
@user1131997: you know, there is a whoe Q&A site where you can ask programming questions like those (hopefully just a little better stated than "why with my code?"). You should try it sometimes, it's called stackoverflow.com
 
@KillianDS huh? such question will be closed in two minutes, by our chat room
 
@Abyx at least there we can close it and downvote it
2
 
2:27 PM
@KillianDS ah, I got it
 
here he ignores every suggestion as to improve his questions (and learn the words "thank" and "you")
 
@KillianDS there are a lot of "thanks" from me , look at history
and thank you again
my questions are rather different, how can I improve them, if they are different?
 
@user1131997: In your function s_i, think about what happens in the very last iteration of the loop. Paying special attention to this line: data[j + 1] = data[j];
 
2:49 PM
@KillianDS He knows them. It reads: "You thank!"
@BenjaminLindley props for actually guiding
 
3:19 PM
> Come in here, and witness the wrath if you mention C++!
Alrighty then, bring on the wrath of C++.
For I'm the Titan, and no one shall stop me.
MUWHAHAHA.
 
@BenjaminLindley is insertion sort algorithm classic view
 
Mat
Anyone playing with DCPU-16 yet? It's got to be a record for me, being addicted to a game I haven't actually played...
 
@Mat lol yep :P
any hoop, home time for me
time to start a nice 4 day weekend :D
 
Mat
I'm already on a 2 week holiday :P
 
@user1131997 And? What's your point?
 
3:27 PM
@BenjaminLindley My point is: to create extension methods, where in each method will be each sorting algorithm and organize them in classes hierarchy ( sort, substring serach, etc... ) and also creating smth like RTTI of algorithms to get in runtime its memory usage and asymptoic speed in big O notation
so, that's why I was asking about extension methods in C++ || emulating them in C/C++
 
@user1131997 No, I mean, why are you telling me that it's insertion sort? I was pointing you toward a bug in your code, did you read what I wrote?
 
@user1131997 asymptotic speed is a statistical (static) property, not runtime
You basically want to run a benchmark for different implementations of sort? Just pass the function as a template argument, and benchmark away
 
@sehe I know, but there are unstable algorithms like quick sort, which can has different asymptotics at runtime ( cause of array element, length... )
@BenjaminLindley May this bug cause memory leak?
 
@user1131997 Has nothing to do with Big-O, and the asymptotics aren't really different. The actual runtime performance varies, though. Again, Big-O is arrived at by statical code analysis
It doesn't even depend on an existing implementation
 
@sehe why nothing? there are average speed and if there were nothing, why there is a class in sorting algos as "unstable"? And what does it mean? It means one algo could run in different usages ( speed, memory ), which depends on array elements, length. No?
 
3:32 PM
@user1131997 First of all, did you find the bug? Did you figure out the problem that happens in the final iteration of the loop?
 
@sehe Yes, Big-O is statical thing one. But unstable algos could have different Big-O at runtime even for ones all.
@BenjaminLindley I have run this code and no problem at my MSV ( not C++/CLI, native one )
 
@user1131997 No. That's simply not Big-O. Even if you say worst case performance is exponential, that would just mean Big-O is O(n^m)
 
@user1131997 I don't care. Running the code with no apparent problems is not proof that there are no problems. Read the code.
 
In computer science, a sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the use of other algorithms (such as search and merge algorithms) that require sorted lists to work correctly; it is also often useful for canonicalizing data and for producing human-readable output. More formally, the output must satisfy two conditions: # The output is in nondecreasing order (each element is no smaller than the previous element according to the desired t...
@sehe look at #section: 2 Comparison of algorithms
@sehe one algo could have different Big-O ( best, average, worst )
@Paying special attention to this line: data[j + 1] = data[j];
// it's exchanging data , simple swapping
 
@user1131997 Swapping which values? (what is the value of j?)
 
3:41 PM
@user1131997 There you go, proof of concept of generic benchmarking function: http://ideone.com/E5ICn
You see it demoes exchanging algorithm implementations as well as input collections
 
@BenjaminLindley proof: ideone.com/Qp6ma
 
@user1131997 I'd really only call worst-case the Big-O, but hey that's just me
 
@sehe cool using callbacks , I haven't see such style earlier, thanks a lot!
 
@user1131997 Proof of what? I was talking about the function s_i in this code you showed here: ideone.com/BBVNN
 
runtime error caused of scanf() result and it's comparing in (get_input_stream() == 1) ? A(&data, &size)
: B(&data, &size);
if to erase == 1 part, that wouldn't be errors , but comparing-action still be shitty in my code
 
3:47 PM
@user1131997 Neat. I don't care. Why do you keep not looking at the thing that I am telling you to look at?
 
you have said: Paying special attention to this line: data[j + 1] = data[j];

right?
 
@user1131997 In the function s_i
 
yes, and why should I pay attention? I think you are trying to tell me the problems of goind over array's length, but I also have posted piece code of this function alone:

http://ideone.com/Qp6ma

Where you can see, that this part is still in code and in ideone's output there is no problem, right?
 
@user1131997 That is not the same function as the function s_i that you provided in your original code here: ideone.com/BBVNN
 
@BenjaminLindley aahhh! here! my appologies, yes this function is unworkable
@BenjaminLindley thank you!
 
4:23 PM
@sehe better not be just you, the official definition for the "big O" is worst case (and that must be worse than or equal to). The best case is the "big Omega" Ω, if they're the same, then you can use the "Big Theta" θ. What we call big O, is actually the small o, that the function is dominated by what's in the parenthesis. en.wikipedia.org/wiki/…
 
Please, critise my code ( trully mine ):

http://ideone.com/s8IIn#ul_inouterr
 
oh, I guess I should have addressed that to @user1131997
can we criticize your spelling instead?
 
@MooingDuck this also too :) thanks!
@MooingDuck about Big-O shall ask you later, when return from shop
 
@user1131997 this is surprisingly well written code, except I don't like the function pointer/renaming thing
sort_quick should probably cuttoff at something above 0. A cutoff at 16 is more common, and brings a significant speed boost
 
4:39 PM
@MooingDuck what about the design of calling print_array() and how does switch-block look? thank you for advice!
 
@user1131997 oh, got distracted. The print array is fine, the switch is good too.
choise => choice
also, the switch should maybe be in a loop so someone could enter multiple entries in one run. Maybe
also, always check the return type of input functions.
what is the purpose of this code? Just to validate the algorithms' correctness?
if so, be sure to test corner cases, like "0", and "0, 0, 0, 0, 0"
as well as "0xFFFFFFFF, 0xFFFFFFFE"
And of course, the standard gotos for sorting "1 2 3" "1 3 2", "2 1 3", "2 3 1", "3 1 2", "3 2 1", "1 0 1 0".
WOOO 10000 REP!
I have to remember not to downvote before I get a little higher :/
 
5:01 PM
@StackedCrooked narrowed your example down to a 33 loc test case - singlethreaded
 
Good afternoon!
 
5:23 PM
> You haven't choose some variant of soring
I choose the 'soring high' variant :)
 
@user1131997 it's just a crap. btw, there is codereview.stackexchange.com
 
@MooingDuck shall I give you a congratulatory flag? Just so you can invalidate it yourself?
 
@MooingDuck you can downvote questions
 
@MooingDuck Gee, I forgot that I never actively knew that anymore :)
 
@MooingDuck cong-rats :P
 
5:32 PM
@jalf Single-threaded? That's surprising!
 
@sehe I'm still learning the tools, I might not notice the flag :(
 
yuo will when it happens
Ok i'm off to my choir
Just printed the new sheet music
 
@sehe you might be surprised at what I don't notice
GAH! Why is it when I copy multiple cells from Microsoft Access to Microsoft Excel, that text is truncated at 255 values?! I keep forgetting, when sending files to clients, and my boss thinks I'm a moron. :/
 
5:48 PM
@StackedCrooked yeah, this one fails too: ideone.com/jlLXD
 
@jalf However, in my original example I never opened a variable as both open_r and open_rw. I mean the STM test, not the other one. So it seems like two different issues.
 
The page for reviewing suggested edits shouldn't remove things. It causes scrolling, making me overlook a bunch
oh, there's a limit on the number of edits I can approve per day? Seems silly. Oh well.
 
@StackedCrooked hmm? Yes you did. All I've done is remove stuff, and gradually merging functions together when they got too small
pretty sure it's the same issue
was just hard to see exactly what was happening because you spread it out across the three different increment functions
but it was all in the same transaction
keep in mind that an open_r/rw call's lasts until the end of the transaction, not just to the end of the lexical scope
 
@jalf Not within the same transaction. Or perhaps I'm overlooking it. Feel free to point out where.
O, sorry.
Perhaps in the transactions where I do both increment_a and increment_b.
 
In increment_a you have b.open_r(tx);. In increment_a you have this->b.open_rw(tx);
so the transaction which calls both functions performs both
it should still work, though. It's not quite the same issue as your first sample
 
5:57 PM
Yep, that's right. Overlooked that.
 
that one was basically broken by design. I can't fix it, you just have to work around it
this one should work
since that other problem is only if you call open_r first, then open_rw, and then use the reference retrieved from the first call
we don't do that here, so it ought to be safe
 
@Abyx why is crap? be more constructive , please! for the link - thank you
 

« first day (537 days earlier)      last day (4423 days later) »