|
by: gong |
last post by:
hi
i recently looked at alexandrescu's book on c++, and i found it pretty
much unintelligible. i have a few points which i wonder about.
1. as a developer, it is important, from a bottom line standpoint, to
make code as transparent as possible. through its lifecycle, code
inevitably becomes larger and more complex to cope with unexpected
demands. if the starting point looks like alexandrescu's code, it
will require very specialized...
|
by: Ben |
last post by:
Hi,
I was writing a expression template for string concatenation latetly.
When writing it, I started to feel curious that why there's not any
generic et lib that can save me from wring each different et lib from
scratch. Or, maybe I was just ignorant and there is some already?
matrix, string, array, vector, whatever, the idea of et is quite
similar. We need a leaf node and a binary non-leaf node for expressing
|
by: daniel.w.gelder |
last post by:
Hello, I have been trying to write a functor template for a week now
and I'm just having tons of trouble because I don't understand an issue
that I guess is pretty basic to this task.
functor<bool (long, long)> myFunctor;
myFunctor = AFunctionOfThatPrototype;
To get that much is elementary because the template can just store a
(bool)(long,long) as a member variable in functor<T>. Here is the
problem:
|
by: daniel.w.gelder |
last post by:
I wrote a template class that takes a function prototype and lets you
store and call a C-level function, like this:
inline string SampleFunction(int, bool) {..}
functor<string (int, bool)> myFunctor = SampleFunction;
string result = myFunctor(7, true);
Works great thanks to the help from this group. Here's the guts so far
for two-arity:
|
by: aaragon |
last post by:
Hi everyone,
I'm trying to provide some external functionality to a class through a
functor object defined by the user. The concept is as follows:
template <class Functor>
class ClassA
{
...
double evaluate(){
|
|
by: Frederick Gotham |
last post by:
For objects, we have "void*" as the generic pointer type. For instance:
enum ParamType { Int, Double };
void Func(void *const p,ParamType const pt)
{
switch (pt)
{
case Int: *(int*)p = 42; break;
case Double: *(double*)p = 42; break;
|
by: Lionel B |
last post by:
I have a function which takes a functor argument. I which to call it for a
functor which is actually a class member; this works fine, using
the mem_fun_ref and bind1st functions (see listing 1 below). Or, rather,
it works fine as long as my member functor is const. The problem comes
when I wish to use it for a *non*-const functor (see listing 2 below):
*** Start listing 1 ***************************************************
// test1.cpp
|
by: Fei Liu |
last post by:
Hello, I have a situation where I need to design a library for
multi-thread application, each thread does some work in a client
supplied std::ptr_fun(free_function) or a functor.
Now since it's a multi-threaded application, naturally I want the call
back functor to be created on a per thread basis.
Suppose my thread is so defined
template <typename servlet_type>
|
by: aaragon |
last post by:
Hi guys,
Is there a way to return a functor from a recursive call that takes
different paths? Let's say that I have a tree structure like:
root
|
first child ---- nextSibling ----nextSibling ----nextSibling
---->0
| |
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|