library-design Questions
1
Solved
In ghci:
Data.Semigroup> 0.1 :: Sum Double
<interactive>:2:1: error: [GHC-39999]
• No instance for ‘Fractional (Sum Double)’
arising from the literal ‘0.1’
• In the expression: 0.1 :: S...
Niigata asked 7/9 at 17:45
5
Solved
There are some threads on Stack Overflow dealing with implementing priority queues in .Net and C#.
My issue is of a more basic nature: Why isn't there a priority queue out of the box in the .Net f...
Unlike asked 14/12, 2009 at 9:33
2
Solved
I have a base class that is intended to be inherited by other users of the code I'm writing, and one of the abstract functions returns a name for the object. Due to the nature of the project that n...
Jocose asked 10/6, 2021 at 17:13
1
Solved
I'm working on some library header file that is supposed to be used from both C and C++. Since C does not have a namespace concept I would add a "library prefix" to all names defined in the header ...
Occiput asked 17/10, 2019 at 5:30
1
Solved
I want to group a set of similar functions in a library in scala.
Here are two approaches I have seen elsewhere. I want to understand the
differences between the two.
Singleton object defined in a...
Homologous asked 31/8, 2018 at 17:47
2
Solved
I was looking at the tutorial for Java 8's new datetime package. On the page about the DayOfWeek and Month enums, it said that the DayOfMonth enum runs from Monday to Sunday. Why is that? Eve...
X asked 24/4, 2018 at 18:4
1
Solved
During reading Microsoft's implementation of Cpp Core Guidelines, I run across two questions:
Why is gsl::string_span provided where gsl::span already works well?
Why is gsl::zstring_span provide...
Saturate asked 18/3, 2018 at 14:22
7
Solved
I have created several C++ libraries that currently are header-only. Both the interface and the implementation of my classes are written in the same .hpp file.
I've recently started thinking that ...
Dredge asked 1/9, 2014 at 13:15
4
Solved
IList<T> does not inherit IList where IEnumerable<out T> inherits IEnumerable.
If out modifier are the only reason then why most of the implementation of IList<T> (e.g. Collectio...
Neukam asked 28/1, 2013 at 9:33
2
Solved
Typically, given some type T, to implement copy and move assignment, one needs two functions
T& operator=(T&&) { ... }
T& operator=(const T&) { ... }
Recently, I come to real...
Boles asked 15/1, 2016 at 4:19
1
Solved
Today we discovered that the functors for multiplying and dividing, are called std::multiplies and std::divides, as opposed to, for example, std::multiply and std::divide respectively.
This i...
Filefish asked 28/3, 2014 at 20:58
1
Solved
Is there a technical reason for the std::this_thread namespace? Why could the members of this namespace not have been implemented as static members of the std::thread class?
Ovid asked 22/2, 2013 at 20:29
0
Why is Microsoft's COM header file named as Unknwn.h, instead of Unknown.h? Is it misprint, or are there objective reasons for such naming?
Unoccupied asked 2/11, 2012 at 18:15
1
Solved
Possible Duplicate:
Why does the C++ standard algorithm “count” return a ptrdiff_t instead of size_t?
There is algorithm std::count/std::count_if in standard C++.
templat...
Exasperation asked 24/9, 2012 at 21:44
2
Solved
I recently ran into a problem caused by using fstream::eof(). I read the following line from here:
The function eof() returns true if the end of the associated input file has been reached, false...
Cynth asked 24/6, 2009 at 17:4
6
What is the essence of allowing the user to create thread by extending the Thread class when we can achieve the same functionality by implementing Runnable and pass it to the Thread constructor.
Cassidycassie asked 26/3, 2011 at 22:8
3
Solved
I understand that using BeginUpdate and EndUpdate on VCL controls such as TListBox speeds up the process of populating the control with Items as it prevents the control from being repainted, until ...
Isomerism asked 5/2, 2012 at 16:24
2
So I know that when using $.fn.each, $.fn.bind, etc, it is standard for the this keyword within jQuery chaining callbacks to be a DOM element.
I know in my development at least I usually want the ...
Gratification asked 9/1, 2012 at 0:15
1
Solved
scala.Predef contains the following code:
// Apparently needed for the xml library
val $scope = scala.xml.TopScope
Did someone figure out why it is necessary, considering that it creates depende...
Cid asked 28/8, 2011 at 17:37
2
Solved
Which solution should be generally preferred, considering that the change is source compatible?
This
object Foo {
val Bar = new Baz(42, "The answer", true)
}
or this?
object Foo {
object Bar...
Domineca asked 25/5, 2011 at 13:23
4
Solved
Background: My latest project cannot use a large library, which saddens me. There are a few things that I would like to have from any library such as the missing functions addClass, hasClass, remov...
Beatification asked 21/5, 2011 at 22:34
2
Solved
It is in ScalaDoc but without much documentation. It seems that it always returns the first parameter.
Function.const(1)(2) for instance returns 1.
Why does it exist and why is it useful?
Smalltime asked 8/5, 2011 at 0:23
5
Solved
Loads of C++ libraries, the standard included, allow you to adapt your objects for use in the libraries. The choice is often between a member function or a free function in the same namespace.
I'...
Sori asked 14/3, 2011 at 14:19
9
Solved
When preparing a library (let's call it libfoo), I find myself presented with the following dilemma: do I write it as a C++ library with a C wrapper:
namespace Foo {
class Bar {
...
};
}
/* Se...
Necessity asked 12/10, 2010 at 7:0
2
Solved
I'm building a database library for my application using sqlite3 as the base. I want to structure it like so:
db/
__init__.py
users.py
blah.py
etc.py
So I would do this in Python:
import ...
Festus asked 18/5, 2010 at 2:56
1 Next >
© 2022 - 2024 — McMap. All rights reserved.