#assertion error

55 messages ยท Page 1 of 1 (latest)

vital torrentBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

hardy helm
patent obsidian
#

Yeah. In your debugger, what line in your code causes this?

hardy helm
#

apperentely 211, this is what i see from the debugger

granite bramble
#

no

#

thats where your breakpoint is

#

you must be throwing in for (const style : new_styles[index])

patent obsidian
#

that's your bp. look in your dap stacks. move until you're in your own code

reef shale
#

Maybe I need to get better at debugging

granite bramble
#

look at the vector type

#

that it spells out

#

in a lot of detail

reef shale
#

Ah

granite bramble
#

because any other value than 0, with the current code, will cause a throw

#

you are only pushing into new_styles once

#

out of a loop

hardy helm
#

it says 249, but if i comment it still gives the same error

granite bramble
#

Ahh

hardy helm
granite bramble
hardy helm
#

the error only goes away when i remove the line 211

patent obsidian
#

if the error goes away, but the code is wrong, it's not actually away

granite bramble
#

and the for loop does nothing

#

for (const Style style : new_styles[index])

this line by itself is already wrong because index must always be 0 for it to work

#

but it's not the immediate problem here

hardy helm
#

what is it?

granite bramble
#

your parameter

#

it's really not good to have multiple local variables with names like "styles" and then also "_styles"

hardy helm
#

even if i hardcode some random style in it it won't work

granite bramble
#

you are bound to make mistakes like this

granite bramble
hardy helm
#

std::vector<std::vector<Style>> styles{ { Style::RED } };

granite bramble
granite bramble
#

your logic is just wrong in several places

#

it will just throw one loop iteration over.

hardy helm
#

i just want to parse something like this:

[bold green]Hello, World![/]

why it is this hard

granite bramble
#

except now it should be throwing here

for (const style : new_styles[index])

if you add the hardcoded red style list

#

am i right?

granite bramble
#

remember, the computer is only doing what you're telling it to do.

#

it's you against yourself :P

hardy helm
#

i have a better idea, let me just git restore everything and start from scratch

granite bramble
#

good luck! :)

#

i believe in you

#

practice makes perfect

#

i will leave this thread now

hardy helm
#

i will delete it i think