Search:
Type: Posts; User: TSLexi
Search:
Search took 0.03 seconds.
-
March 1st, 2014, 05:18 PM
Actually, for iterating through an array, you don't need to pass a variable for the size; just write:
for (auto& val: arrayname)
//do useful stuff
-
February 28th, 2014, 03:22 PM
Well, the instructor required us to write getter and setter methods for Employee's data members.
Also, as of yet, we have no idea if the implementation of Employee will significantly change in its...
-
February 27th, 2014, 07:02 PM
OK, here's the final version (I modified the move ctor so it just switches the pointers around):
Employee.hpp
//inclusion guards
#ifndef EMPLOYEE_HPP
#define EMPLOYEE_HPP
//including...
-
February 26th, 2014, 07:29 PM
Also, should my functions pass arguments by value, by const lvalue ref, or by rvalue ref?
-
February 26th, 2014, 06:45 PM
He told us we'll be inheriting from Employee in later assignments.
-
February 26th, 2014, 05:51 PM
Hi guys,
I'd like some advice on my C++ homework, which is to create an Employee class with three data members (first name, last name, and salary), accessor methods for each, and a function to...
-
February 3rd, 2014, 01:37 PM
I'm writing and running this on my Samsung S4.
-
February 2nd, 2014, 05:44 AM
So we've moved from arguing execution speed to arguing compile speed...compile in the cloud for fast compilation, execute on multi-core chipsets for fast execution.
-
February 2nd, 2014, 01:31 AM
class Functor
{
public:
Functor();
Functor(const Functor & rhs) = default;
virtual ~Functor() =default;
virtual float operator() (const FloatV & input) const =0;
virtual int...
-
February 2nd, 2014, 12:47 AM
Why won't the committee require compilers to implement devirtualization in order to be compliant?
-
February 1st, 2014, 07:39 PM
The C++ standard should require compilers to support devirtualization in order to be compliant.
TMP is wonderful for automatic code-generation, but an exercise in psychosis for code-optimization....
-
February 1st, 2014, 07:02 PM
https://www.thc.org/root/phun/unmaintain.html
-
February 1st, 2014, 06:47 PM
If your design method is completely based on a compiler flaw, you shouldn't be programming. It's a recipe for unmaintainable code
-
February 1st, 2014, 06:13 PM
That's the point I was trying to make. CRTP is an idiom only needed if your compiler lacks the ability to devirtualize your virtual function calls after static code analysis determines dynamic...
-
February 1st, 2014, 02:06 PM
That was an awesome reply. When would *you* use CRTP over virtual functions? When your design says that the pointed to object can never be changed at runtime?
I just "get" virtual functions. I...
-
February 1st, 2014, 12:51 AM
Just need to get a microSD card and buy the ROEHSOFT Memory Expander from Google Play. Then it should work.
The multi-threading component of the stdlib is 64-bit, so my 2GB 32-bit system runs out...
-
January 31st, 2014, 08:44 PM
Apparently GCC requires 3.1GiB of RAM to compile this simple program...
#include <iostream>
#include <future>
using std::cout;
using std::endl;
using std::future;
using std::async;
-
January 31st, 2014, 07:27 PM
Hi guys,
I'd like some advice on designing and implementing my neural network class. It has three input neurons, four hidden neurons (one of which is a bias neuron, having the connections from...
-
January 31st, 2014, 04:49 AM
I was reading about the CRTP, and I can't for the life of me understand it's advantages over virtual functions.
Unless you're coding embedded systems, and can't afford the few extra bytes for the...
-
January 30th, 2014, 06:36 AM
I fixed it. No exceptions, and output is correct.
I forgot to declare GetArgNum() as virtual, so Trainer's ctor was calling Functor's instead of Plane's.
-
January 30th, 2014, 05:24 AM
The TrainingData vector in Trainer seems to be one longer than it should be. The exception is coming from Plane's function call operator.
-
January 30th, 2014, 04:15 AM
My perceptron's train function seems to materialize my BadInput exception object out of nowhere. Yet, everything works fine.
And when I put an forever loop in main to validate the output with...
-
January 30th, 2014, 12:54 AM
-
January 30th, 2014, 12:26 AM
Functor.hpp
#ifndef FUNCTOR_HPP
#define FUNCTOR_HPP
#include "Typedefs.hpp"
template <typename T>
class Functor
{
-
January 30th, 2014, 12:13 AM
|
Click Here to Expand Forum to Full Width
|