Quantcast
Channel: User dani - Stack Overflow
Browsing all 40 articles
Browse latest View live

Comment by dani on How to create an error on dereferencing a nullpointer?

When running in debug mode, your favorit ide will give the location of the error.

View Article


Comment by dani on Is it possible to write a using declaration for a method...

@StoryTeller There is no specific problem I need to solve that involves the above topic. It would just be a way to make things more compact. That's all.

View Article


Comment by dani on Checking that a template type T is part of a variadic...

My question here had four working lines, the answer had only one. Solutions you find here for making a tuple of vectors of some types in a pack are longer than 10 lines. Its now doable in one.

View Article

Comment by dani on If I cast the this pointer of a base class to the derived...

yes, this was what i mean.

View Article

Comment by dani on What should a function return that can fail?

I did considered exceptions but i think it's not really a good fit. I use exceptions as an way to prevent abnormal behaviour, failure in this case is not abnormal. It might be unlikely or occur seldom,...

View Article


Comment by dani on How can I mock object that is stored as a unique_ptr in...

Oh i see. I thought that what ever goes into the EXPECT_CALL must stay valid until the call happens.

View Article

Comment by dani on How can I "add_dependencies(..)" to an "UNKNOWN IMPORTED"...

The path is not wrong. In fact, the error occours before anything is starting to build. there can't be any gtest.a since the dependency is ignored.

View Article

Comment by dani on How can I "add_dependencies(..)" to an "UNKNOWN IMPORTED"...

see my comment below Mizux Dev's answer. Could it be possible that add_dependency is ignored for IMPORTED targets? Could it be that the error occours because ninja want's to build things in parallel...

View Article


Comment by dani on Howto do floating point compasiosn in an if-statement...

In my real code, I call an external (serial) program that runs for 2-3 minutes (instead of echo "react..."). Is there no way to get this done? Do I need to put the parallel stuff in an extra shell script?

View Article


Comment by dani on Set default value of an integer column in SQLite

The UNIQUE statement is not needed and already implied by the PRIMARY KEY statement.

View Article

Comment by dani on How do i use add_subdirectory() after...

@John, I think this is exactly the answer that deserves to be accepted.

View Article

Comment by dani on ggplot2 facet labeller with bquote

I would refer to my answer here: stackoverflow.com/a/58307679/3392714

View Article

Comment by dani on How can I make `bquote` replace the greek letter stored in...

Thank you for your answer. It solved the problem in the question. I discovered however, that it actually i not my only problem. Maybe you are interested in my follow up question:...

View Article


Comment by dani on `bquote` is not interpreting the styling elements within a...

What is shown on the y axis. I want that bquote styles the variable content instead of taking it as a simple string...

View Article

How to setup meson with Qt creator

I normally use Qt creator with cmake to program C++ projects. Lately I read quite a bit about meson and it's simplicity and I like to test it. This example explains how to setup meson.When using meson,...

View Article


Will a `if` or `return` quit early if the condition is fulfilled? [duplicate]

I'm wondering if a if statement or a returnquits early if possible. E.g. in this code:bool Point::operator==(const Point &rhs) const{ return (x==rhs.x //if the x's are not equal, there's no point...

View Article

Howto use a fold expression with a specific type?

I've a function to check if a std::string contains a substring. I pass the strings around as std::string_view, such that no copy takes place.bool containsSubstr(std::string_view str, std::string_view...

View Article


Reshaping a matrix or table into a dataframe

I have a situation where I read data from a file. Each line of file has a time stamp followed by three measurement results. Something like this:> time <- c(0., 0.6, 1.1, 1.9)> d1 <- c(6.4,...

View Article

Is the answer given for "Why switch statement cannot be applied on strings?"...

I came across this question:Why switch statement cannot be applied on strings?and wonder if the answer:The reason why has to do with the type system. C/C++ doesn't really support strings as a type. It...

View Article

Passing a callable to a object that builds some kind of multi-index container

I'm trying to write a container that is able to categories objects and store pointers for which a categorisation function is true.My problem is, that it does not compile and since I'm inexperienced in...

View Article
Browsing all 40 articles
Browse latest View live


Latest Images